Image to Base64 🔒 Runs locally in your browser — nothing is uploaded.

Convert an image to a base64 data URI, or decode one back into a file.

Image → Base64

📷 Drop an image here, or click to choose

Base64 → Image

Starts with "data:"? We auto-detect the MIME type and check it is Base64-encoded. Otherwise, pick the type above.

About this tool

Base64 turns raw image bytes into plain text, which is handy anywhere a binary file doesn't fit: embedding a small icon straight inside a CSS `background-image`, an HTML `<img src>`, or a JSON API payload, all without a separate file request. This tool does both directions — drop an image to get its Base64 text, or paste Base64 (or a full data URI) to rebuild and download the image.

Encoding reads the file's raw bytes directly and re-expresses them as text — no canvas redraw, so the output decodes back to the exact original file, byte for byte. Everything happens locally in your browser; nothing is uploaded anywhere. Keep in mind Base64 text runs about a third larger than the original binary, so it suits small icons and thumbnails far better than large photos.

Frequently asked questions

Does encoding to base64 change the image quality?

No — base64 is a text encoding of the exact original file bytes, not a re-compression of the image. The resulting string decodes back into a byte-for-byte identical file, just represented as text instead of binary (which is why it's roughly 33% larger than the original file size — that's the cost of representing arbitrary bytes as printable text, not any loss of image data).

Why is my encoded string so much larger than the original file?

Base64 encodes every 3 raw bytes as 4 text characters, which is a mathematically fixed ~33% size increase — this is normal and expected for ANY base64 encoding, not specific to images. It's a worthwhile tradeoff when you want to embed a small image directly in text-based formats (CSS, HTML, JSON) to avoid a separate network request, but isn't a good choice for large images where the extra size outweighs the benefit of skipping one request.