Uber Tools

Image to Base64

Turn an image into a Base64 data URL, ready for CSS, HTML, Markdown or JSON, in your browser

Drop an image here

Or choose one: JPG, PNG, WebP, AVIF, GIF, SVG, ICO, HEIC; it's read in your browser and never uploaded

To turn Base64 back into an image, or any file into Base64, use the Base64 Encoder / Decoder.


How to convert an image to Base64

  1. Drop an image on the page or choose it: JPG, PNG, WebP, AVIF, GIF, SVG, ICO or HEIC.
  2. Make it smaller first if you like (WebP, JPG or PNG, at a quality and a largest size).
  3. Copy the data URL, the Base64 alone, a CSS background, an HTML img tag, Markdown or JSON, or download it as a text file.

Questions

What is a Base64 data URL for?

It puts an image inside your HTML, CSS or JSON as text, so it loads without a separate file: handy for small icons, emails and single file pages.

Why is the Base64 larger than the image?

Base64 writes 3 bytes as 4 characters, so it's about a third larger. Making the image smaller first, or using an SVG as text, keeps it short.

Can I use an SVG without Base64?

Yes, an SVG can be written as URL encoded text, which is smaller than its Base64.

Is my image uploaded?

No, it's read by your browser, on your device. To turn Base64 back into a file, use the Base64 Encoder / Decoder.

Related tools