Image to Base64

Turn an image into a data URI you can paste into code.

Image to Base64 encodes a picture as a Base64 data URI ready to paste into CSS, HTML, JSON or an email template. It shows the encoded size, warns when inlining is a bad idea, and gives you ready-made snippets for each context. Encoding happens locally with the FileReader API.

Loading Image to Base64…

Runs entirely on your device. No file or text you enter here is uploaded. How to verify it.

How to use Image to Base64

  1. Add an image.
  2. Copy the raw Base64, the data URI, or a ready-made CSS/HTML/Markdown snippet.
  3. Paste it wherever you need it.

Questions about Image to Base64

How much bigger does Base64 make a file?
About 33% larger, because every three bytes become four ASCII characters. A 30 KB icon becomes roughly 40 KB of text.
When is inlining actually a good idea?
For small assets under about 4 KB — icons, a 1px gradient, an email logo — where saving an HTTP request outweighs the size penalty. Inlining a 500 KB hero photo blocks your stylesheet parse and cannot be cached separately.
Does this work the other way round?
Yes, use Base64 to Image to decode a data URI back into a downloadable file.
Does it handle SVG files?
Yes, and SVG is one of the few formats where inlining reliably pays off, because the markup is small and compresses well inside a stylesheet. URL-encoding an SVG is shorter than Base64, but Base64 avoids quoting problems in build tools that mangle raw markup.
Is there a size limit on the image?
No fixed limit, though the output becomes unwieldy quickly: a 2 MB photo produces roughly 2.7 MB of characters, which many editors struggle to paste. Above a few hundred kilobytes, a normal file reference is the better answer.
Is Image to Base64 really free, with no limits?
Yes. There is no account, no daily cap, no file-size tier and no watermark, because there is no server cost to recover. The site is funded by clearly disclosed partner recommendations on the Partners page, never by metering the tools.
Are my files or text uploaded when I use Image to Base64?
No. Everything is processed by JavaScript running in your browser, on your device. You can verify it: open your browser's developer tools, switch to the Network tab, and use the tool. You will see no request carrying your data — because there is nowhere for it to go.