Skip to content
ImageDoctor

Image to Base64

Encode an image as a Base64 string or data URI, with ready-made HTML, CSS and JSX snippets.

Drop an image to encode

Produces a Base64 string or a full data URI, plus copy-ready snippets.

Processed locally in your browser

JPG · PNG · WebP · AVIF · GIF · BMP · TIFF · SVG

When inlining is worth it

Base64 inflates a file by roughly a third and cannot be cached separately from the document that contains it. It is a good fit for tiny assets — icons, 1px gradients, placeholders — and a poor one for photographs.

When to use Base64 images

Base64 turns a file into plain text, so a small image can live inside HTML, CSS, JSON or an email template without a separate request. The encoder uses the original file bytes unchanged.

Copy the full data URI or the bare Base64 string, or a ready-made snippet for an HTML <img>, a CSS background-image, Markdown or JSX. The character count, size and overhead are shown.

Base64 is about a third larger than the binary file, so it suits icons and small images. For photos, a normal image file is almost always better.

Common questions

Drop the image in. The data URI appears immediately; copy it, or copy one of the HTML, CSS, Markdown or JSX snippets.

Base64 uses 4 text characters for every 3 bytes, which adds about 33%.

No. The encoding happens in your browser.

We use Microsoft Clarity analytics cookies to see how the site is used and fix what's broken. Your images are never uploaded. Privacy Policy