Image to Base64 Converter

Embed a small image in CSS, HTML or JSON without a second file, or restore a Base64 string into an image you can save. Your files never leave the browser.

Free Runs locally No signup
Mode
Drop an image herePNG, JPG, WebP, GIF, SVG or AVIF · up to 8 MB
Files are processed in your browser and never uploaded.

How to use it

1

Choose a direction

Convert an image file to Base64, or paste a Base64 string to rebuild the image.

2

Drop or paste your file

Drag an image into the box, pick one from your device, or paste the Base64 payload.

3

Copy or download

Copy the data URI, HTML or CSS snippet, or download the decoded image in its original format.

Why use this tool

Ready-to-paste snippets

Output a plain data URI, an img tag or a CSS background rule without editing the string by hand.

Format detection

The decoder reads the file signature, so PNG, JPEG, WebP, GIF, SVG and AVIF are recognised automatically.

Size awareness

See the original size, the Base64 length and the overhead before you commit the image to a bundle.

Frequently asked questions

How much larger is Base64 than the original file?
Base64 adds about 33 percent, because every three bytes become four characters. A 30 KB icon becomes roughly 40 KB of text.
When should I embed an image?
Small icons, logos, fonts and placeholders are good candidates. Large photos bloat HTML, block rendering and cannot be cached separately.
Which image formats are supported?
Any image the browser can read. Encoding keeps the original bytes, and decoding detects PNG, JPEG, WebP, GIF, SVG, AVIF, BMP and ICO.
Does transparency survive?
Yes. The file is not re-encoded, so PNG, WebP, GIF and SVG transparency is preserved exactly.
Is Base64 good for SEO?
No. Search engines prefer normal image URLs with alt text and caching. Use data URIs for small decorative assets, not content images.

Related guides

Related tools

Last updated: