Image to Base64 Converter

Convert a small image into text you can paste straight into HTML, CSS or JSON. The reverse direction is included too.

Turn Base64 back into an image

Runs in your browser. What you enter here is not sent to our server.

  • Data URI, raw Base64, HTML or CSS output
  • Decodes Base64 back to an image
  • Handles PNG, JPG, SVG, WebP and GIF

How to use the Image to Base64 Converter

  1. Choose an image up to 5 MB.
  2. Pick the output you need: a data URI, plain Base64, an HTML image tag or a CSS background rule.
  3. Copy the text or download it as a file.

When is embedding an image worth it?

A data URI saves one network request, which helps for tiny icons and for single-file HTML emails or documents. The cost is size: Base64 text is about a third larger than the original file and cannot be cached separately. As a rule of thumb, embed images of a few kilobytes and link to anything bigger.

Questions about the Image to Base64 Converter

Why is the Base64 version bigger than my file?

Base64 represents every 3 bytes as 4 text characters, so the text is roughly 33% larger than the file it encodes.

Can I convert Base64 back into an image?

Yes. Open “Turn Base64 back into an image”, paste the text and the picture is shown and downloaded.