Image to Base64 converter
Runs entirely in your browser. Your files and data never leave your device.
About this tool
This tool goes both ways between an image file and its Base64 text. Drop in a JPEG, PNG, GIF, WebP, or SVG and it prints the full data: URI, ready to paste into CSS, HTML, JSON, or an email template. Or paste a data URI or a raw Base64 string and it decodes it back into an image you can preview and download.
How does it detect the image format?
If you paste a full data: URI, the MIME type is already right there in the string. But if you only have a raw Base64 blob with no header, the tool reads the first bytes of the decoded data and checks them against the known signatures for PNG, JPEG, GIF, and WebP files, the same “magic bytes” that identify a file format regardless of its extension. SVG is a special case since it’s text rather than a binary format, so it’s detected by checking whether the decoded content starts with <svg or an <?xml declaration. If none of those match, the tool tells you it can’t identify the format rather than guessing.
Are my images uploaded anywhere?
No. Everything happens in your browser using the FileReader API and standard Base64 encoding, no image is ever sent to a server. That makes this fine to use on screenshots, private documents, or anything else you don’t want leaving your machine, even though data URIs themselves are just plain text.
What’s it useful for?
Base64 images are common for embedding small icons directly inside a stylesheet, which saves the browser from making a separate HTTP request for each one. They’re also useful for shipping inline images in emails and single-file HTML exports, where linking to an external image file isn’t practical. On the decoding side, this tool is handy when you’ve got a Base64 string in some API response, a config file, or a log line and just want to see what image it actually is. Keep in mind Base64 encoding adds about 33% overhead over the raw file size, so it’s best for small images rather than full photos. See MDN’s guide on data URIs for the syntax and when they’re worth using over a regular image file.