Base64 to image
Paste a Base64 string or a whole data: URI and get the file back, named after
what its bytes actually are. Nothing you paste leaves this tab.
Drop a text file here or click to choose
Or paste the Base64 below — either way it is decoded on this device
Line breaks, spaces and a leading data URI header are all fine — they are stripped before decoding. What the file turns out to be is read from its first bytes, not from the header, because a data URI is only a label somebody typed.
How it works
-
Paste the string, or drop a
.txtfile holding it. Adata:…;base64,header is fine; so are line breaks. - Press Decode. The header is parsed, whitespace is removed, the alphabet is checked, and the payload is turned back into bytes.
- The first bytes are matched against a table of file signatures to name the file and choose its extension. An image gets a preview; every file gets a download.
Why the bytes decide, not the header
A data URI header is a string somebody typed. Nothing checks it, nothing enforces it, and
it is wrong often enough to matter — a screenshot pipeline that always writes
image/png will happily wrap a JPEG in it. Trusting the header would then hand
you a .png that no image editor can open, and the failure would look like our
fault rather than the label's.
So the header is treated as a hint and the bytes as the answer. When the two disagree, the result line says both: what the file is, and what the URI claimed. That is usually the most useful thing on the screen, because it tells you which end of your pipeline is lying.
Where the text goes
It stays here. Decoding is arithmetic the browser already knows how to do, and the file it produces is a blob in this tab's memory, handed to the download link and to nothing else. There is no upload step, because there is no server on our side that could receive one.
Being precise about it: the page loads, the fonts load and the ads on it make requests, so the network tab is not blank. The claim to check is that no request carries your string. It is worth checking on a decoder in particular — people paste tokens, keys and private documents into these, and most of the alternatives do the work on a backend.
Frequently asked questions
Do I have to strip the data:image/png;base64, part first?
No. Paste the whole thing. The header is recognised and removed, and so are line breaks, spaces and tabs — Base64 that travelled through an email or a code editor usually arrives wrapped at 76 characters a line. Base64 written in the URL-safe alphabet, with dashes and underscores instead of plus and slash, is accepted too, as is a payload whose trailing equals signs were stripped.
How does it know what kind of file came out?
By reading the bytes it just produced. A PNG starts with a fixed eight-byte signature, a JPEG with FF D8 FF, a PDF with %PDF-, a ZIP with PK, and so on down a table. That is what names the file and picks the extension. If a data URI header was present it is shown too, and if the header disagrees with the bytes the result says so — a mislabelled data URI usually means the string came from somewhere that guessed.
What if it is not an image?
It still decodes. Images get a preview above the download because there is something to look at; a PDF, a ZIP, a font or an unrecognised blob gets the download and a line naming what the bytes turned out to be. Nothing is refused for not being a picture.
Why did I get an error on a string that looks fine?
Three things break otherwise-valid Base64 most often. A stray character that is not in the alphabet — a curly quote picked up from a chat app is the classic one — and the error names the character it found. A truncated string, where the final group has one character instead of two, three or four, which cannot be completed. And a data URI that is percent-encoded rather than Base64, which carries text rather than a file; those have no ;base64 in the header.
An SVG decoded but there is no preview. Why?
Because an SVG is a document, not a picture: it can carry script and references to other servers, and drawing one here would mean running it. The file is decoded and offered for download either way. To look at it safely, take it to our SVG viewer, which strips scripts, event handlers and remote references before it draws anything.
Is anything I paste sent anywhere?
No. The text is decoded by JavaScript in this tab and the file is built as a blob in your browser’s memory. Nothing is posted. The page, its fonts and the ads on it make their own requests, so a network tab is not empty here — but none of those requests contains what you pasted. That matters more than usual on this particular tool: a Base64 string is a very ordinary way to move a private key, a signed token or a scanned document around.
How much can it decode at once?
Up to 70 million characters of Base64, which is roughly a 52 MB file. A 50 MB file — 69,905,068 characters — was measured through it here and came back byte for byte. There is one thing worth knowing about the large end: a text file that long is not put into the box. Assigning a string that size to a text area makes the browser lay out every character of it, which was measured at 2.3 seconds for eight million characters and would be far worse at seventy. So a big dropped file is held aside, the box says so, and the decode reads from what is held.