Image to Base64

Convert an image to a Base64 data URI for HTML, CSS, JSON, and more

Free plan: 20 uses/day

Get unlimited uses, batch processing, priority results and no ads with ImageTools Pro.

20 of 20 free uses left today

Upgrade to Pro

Drag & drop your image here

or click to browse

.JPG · .JPEG · .PNG · .WEBP · .GIF — Max file size: 20MB

Advertisement

Frequently Asked Questions

What is base64 for images?

It encodes binary image data as plain text, handy for embeds, JSON payloads and inline resources.

Does base64 increase file size?

Yes — about 33%, because 6 bits fit into one text character. That is normal for the format.

Can I copy the result easily?

Yes — one click copies the full data URI, and you can download it as a text file too.

Is base64 good for emailing images?

Only inside HTML newsletters in small doses — inline images add ~33% overhead and bigger emails get flagged.

How this tool works

Base64 turns an image into a text string you can paste directly into HTML, CSS or JSON. The encoded text always decodes back to the exact same bytes - it is a packaging format, not a compression one.

  • Upload an image and the tool encodes it as a data URI (data:image/png;base64,...) ready to paste. Choose between a plain encoded string and a complete CSS url() wrapper, plus the output format if you want to re-encode first.
  • Decoding works the same way: paste a data URI and the tool rebuilds the original file. Everything happens in your browser, so private images never travel anywhere.

When inlining an image is worth it

Small assets (icons, logos, placeholders under roughly 4KB) benefit from inlining: the browser skips an extra HTTP request, the page paints sooner on slow networks, and the image still shows if a CDN is down. Email templates and single-file HTML demos rely on it for the same reason.

Large images do not: Base64 adds 33% overhead, cannot be cached separately, and bloats the document that carries it. The practical rule is inline the tiny ones, link the rest - and after pasting, render the page once to confirm your CMS or proxy keeps the data URI intact.

Pro tip: Need it smaller? Convert to WebP first, then encode: WebP files are typically 25-35% smaller, and the Base64 string shrinks with them.

Advertisement

Tools we recommend

We value your privacy

This site is ad-supported by a partner that may set a cookie to personalize ads. Reject and no third-party ad scripts load at all. All image processing stays 100% in your browser either way.