About Image to Base64 Converter & Data URI Online
This Base64 image and data-URI converter turns any image — PNG, JPEG, GIF, WebP, BMP, or SVG — into a `data:` URI you can paste straight into HTML, CSS, or JSON, and decodes a data URI back into a viewable, downloadable image. Embedding an image as base64 removes a separate HTTP request, which is handy for small icons, email templates, and self-contained snippets.
Drop a file to encode it, or paste an existing image data URI to preview it instantly, read its MIME type and pixel dimensions, and download the bytes as a real file. It is the same workflow whether you are inlining an asset or inspecting one someone handed you.
Everything runs locally in your browser using the built-in FileReader, `btoa`/`atob`, and Blob APIs. No image you load is ever uploaded, so the tool works completely offline and your files stay on your device.
Features
- Encode any image to a data URI ready for HTML/CSS/JSON, with one-click copy
- Decode a data URI to a live preview, with MIME type and pixel dimensions
- Download decoded images as a real file via a Blob object URL
- Magic-byte MIME sniffing; fully offline — nothing leaves your browser
How to use
- Choose Encode to turn an image into base64, or Decode to read one back.
- In Encode, drop an image onto the dropzone (or click to browse) and copy the data URI from the output pane.
- In Decode, paste a data URI into the input box to see the image, its MIME type, and its dimensions.
- Click Download to save the decoded image to your device.
Frequently asked questions
What is an image data URI?
A data URI embeds a file directly inside a string using the form data:<mime>;base64,<payload>. For images it lets you place the picture inline in HTML or CSS instead of linking to a separate file, removing one network request.
Why is a base64 image larger than the original file?
Base64 represents every 3 bytes as 4 ASCII characters, so the encoded text is about 33% bigger than the raw image. Inlining is best for small assets; large images are usually better served as normal files.
Does this tool upload my images anywhere?
No. Encoding and decoding happen entirely in your browser with FileReader, btoa/atob, and Blob. Your images never leave your device, so it works offline.
Which image formats are supported?
Any image the browser can read — PNG, JPEG, GIF, WebP, BMP, ICO, and SVG. The tool detects the MIME type from the file or from the data URI prefix so the preview and download use the right format.
How do I convert a Base64 string back to an image?
Switch to Decode and paste the full data URI (the data:image/...;base64, prefix plus the payload). The tool renders a live preview, reports the MIME type and pixel dimensions, and lets you download the decoded bytes as a real image file.
Related tools
Everything runs locally in your browser — your input is never uploaded.