Base64 Image Viewer
Convert a base64 data URI into a viewable, downloadable image — or turn an image file on disk into a base64 data URI. Detects PNG, JPEG, GIF, WebP and SVG automatically. Runs entirely in your browser.
Mode
Base64 data
How it works
- Base64 → Image: accepts a full
data:URI or raw base64. The MIME type comes from the URI prefix, or is sniffed from the magic bytes when missing (PNGiVBORw0KGgo=, JPEG/9j/, GIFR0lGOD, WebPUklGR, SVGPHN2Zw==). - Size is computed from the base64 length (
length × 3/4minus padding), so you get the decoded byte count without downloading anything. - The Download button rebuilds the original bytes into a Blob and saves it with the right file extension.
- Image → Base64: pick a local file and it is read with
FileReader.readAsDataURL— the result is shown as a text data URI ready to copy. - Everything runs locally; no image data is ever uploaded.
About Base64 Image Viewer
Base64-encoded images show up everywhere — email HTML, CSS backgrounds, API payloads, JSON fixtures — and while they are easy to generate, they are hard to inspect: you cannot tell the format, the real size, or whether the payload is even valid just by looking at the string. This viewer decodes the payload in memory, reports the detected type and byte size, renders the actual image, and lets you download the original file again.
The reverse direction is just as useful: when you need an image inline — a placeholder, a test fixture, or an attachment payload — pick the file and copy the generated data URI. The tool detects invalid base64, flags PDFs and other non-image payloads, and handles SVG as text so it works with the browser’s built-in encoding APIs without any external libraries.