πŸ”¨ All in one Utilities

Base64 to Image Viewer

Great utilities that help you design, program and maintain your website

utilities for you to make a website
Home » Utilities » Base64 to Image Viewer

Base64 to Image Viewer

The prefix is optional β€” the format is detected from the data either way. Decoding happens in your browser; the image is never uploaded.
Drop a .txt file here, or click to choose one
Preview of the decoded image
Format
Dimensions
Aspect ratio
Decoded size
Base64 overhead

Hint: A data URI is about a third larger than the file it came from, so inlining is a win for small icons and a loss for photographs. The overhead figure above tells you which one you are looking at.

Base64 image strings turn up in places you did not put them: a CSS file someone else wrote, a JSON payload from an API, an email template, a database column. This viewer takes the string and shows you what it actually is β€” the image itself, its real pixel dimensions, the decoded byte size, and the format, which it works out from the data rather than trusting the prefix.

The prefix is optional. Paste a full data URI or the bare Base64 and you get the same result, because the format is identified from the first few bytes of the decoded data. Line breaks, stray spaces and the URL-safe alphabet are all tolerated, since those are what you get when a string has been through a terminal, an email client or a JWT.

The number worth paying attention to is the overhead. Base64 encodes three bytes into four characters, so a data URI is roughly 33% larger than the file it came from. For a 400-byte icon that is a fair trade against an extra HTTP request. For a 200 KB photograph it is 66 KB of pure waste sitting in your stylesheet, uncacheable and blocking the render of everything after it. The overhead figure tells you which situation you are in before you commit.

Decoding happens in the browser. The string never leaves the machine, which matters when the image came from a client's private system.

Frequently Asked Questions

Why does my string show as "not a recognised image format"?

The Base64 decoded cleanly but the bytes are not an image β€” most often you have a PDF, a font, or a Base64-encoded text file. It can also mean the string was truncated in transit, which is common when copying out of a terminal that wrapped the line.

Can I download an SVG as PNG or JPG?

Not through the download buttons. Converting an SVG to a bitmap requires rendering it to a canvas, and browsers block reading pixels back out of a canvas that has had an SVG drawn onto it. Use Open full size and save from there, or rasterise the SVG in a graphics editor first.

Is there a size limit?

Only what the browser will hold in memory. Strings over a few megabytes make the textarea sluggish long before decoding becomes a problem β€” for those, load the string from a .txt file instead of pasting it.

Does the image get uploaded anywhere?

No. Decoding uses the browser's own atob and canvas, and there is no request to any server. You can confirm it by opening the network tab, or by disconnecting and using the tool offline.

Related Utilities