Image to Base64 Converter

Turn an image into a Base64-encoded data URL. Fast, free, and fully client-side.

How the Image to Base64 Converter Works

Convert an image file into a Base64 data URL that you can paste into HTML, CSS, or JSON. The output starts with a type prefix such as data:image/png;base64, followed by the encoded file contents. The text appears in a read-only box with a character count and a copy button. Encoding happens in your browser, and the image is never uploaded to a server.

Usage Example

Embedding a small icon directly into a stylesheet as a data URL so the page needs one fewer file request.

Frequently Asked Questions

Why does the output begin with data:image?

The prefix tells the browser the media type, so the string can be used directly as the src of an img tag or in a CSS url. Keep the prefix intact when you paste the output into markup.

Is the Base64 text much larger than the image?

Yes. Base64 represents binary data as text, so the output is roughly a third larger than the original file. Large photos produce very long strings, which is why small icons and graphics suit this format best.

How do I copy the output?

Use the copy button beside the output box, or select the text manually. The character count helps you check the length before pasting into a field that has a size limit.

Browse more

See all image manipulation tools.