Toolvore

Base64 to Image

Preview and download an image from Base64 or a data URI.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

Turn a Base64 data URI back into a viewable, downloadable image file, which is what you need when a payload or a stylesheet has one embedded in it.

How to use it

  1. 1Paste the Base64 into the box — with or without the leading data:image/…;base64, part.
  2. 2Press Preview Image; the detected type is printed above the picture, on a checkerboard so transparency is visible.
  3. 3Download it — the file extension comes from the detected type, so image/svg+xml saves as image.svg.

Example

Input
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
Output
Detected type: image/gif — a 1 × 1 transparent pixel, downloadable as image.gif

No prefix was needed: R0lGOD is what a GIF header looks like in Base64. The same trick recognises iVBORw0KGgo as PNG, /9j/ as JPEG and UklGR as WebP. Anything unrecognised is assumed to be PNG, which is why a string can decode cleanly and still refuse to display.

What happens to your data

Decoding happens in your browser from the text you pasted — the data URI is handed directly to an img tag. No request leaves the page and the string is never sent to us.

Last updated August 2026

You have opened a stylesheet, an API response or the source of an email and found a wall of characters beginning iVBORw0KGgo where a picture ought to be. Somebody encoded a file into text so it could travel inside another file, and now you need to see what it actually is.

Work out which of two things you are holding before anything else. A data URI announces itself: it opens with data:, names a media type, and puts a comma before the payload, so the type is declared rather than inferred. A bare payload is the encoded file and nothing else — no name, no size, no declared type. Everything a filesystem would have told you was dropped at the encoding step.

Base64 also has no length field, and that is behind most of the trouble people hit. A string cut short by a log, a copy that missed the last line or a column limit in a database viewer looks exactly like a complete one, right up until a renderer reaches the end and finds the file unfinished. Blank output or a broken icon usually means the copy, not the encoding.

It is worth checking you have an image at all. The same encoding carries PDFs, fonts and archives, and a JWT segment or a block of encoded text decodes perfectly well and is still nothing you can look at.

How it works

Toolvore does the whole job inside the page, and does very little decoding of its own. Whitespace is stripped from what you paste, so a string wrapped across dozens of lines is treated as one. If the text opens with data: followed by a media type and the base64 marker, that declared type is trusted and the string goes to an image element as typed. Otherwise the opening characters are matched against a short list of encoded file signatures, and the payload is wrapped in a data URI built from whatever that match produced. Only the first hundred characters are actually decoded as a check, which catches a stray character at the front and says nothing about the rest — a string corrupt or truncated further down passes that check and then fails to draw, which is why there are two different failure messages. The picture is drawn by the browser's own image decoder, so anything your browser cannot open, this cannot either.

Common use cases

  • Seeing what an inline background-image in a stylesheet shows
  • Checking an avatar returned as a Base64 field by an API
  • Recovering an image pasted as Base64 into a bug report
  • Inspecting a picture embedded in a webhook payload
  • Confirming a signature stored in a database column
  • Pulling an icon out of a build output that inlined it
  • Checking transparency on a decoded logo

Frequently asked questions

Why is my Base64 image not displaying?

Nearly always the string rather than the decoder. Truncation is commonest: Base64 carries no length, so a copy that missed the final line or a log that cut the entry short looks intact and stops mid-file. Next is Base64URL, the variant used in JWTs, which swaps plus and slash for minus and underscore and is refused by a standard decoder. The two failures read differently here — a complaint about invalid Base64 points at the opening characters, while a message about it not being a valid image means the text decoded and nothing could be drawn from it.

What does data:image/png;base64 actually mean?

The shape is data:, then a media type, then optional parameters, then a comma, then the payload. It is defined by RFC 2397 and works anywhere a URL does: an img src, a CSS background, an anchor href. The base64 word before the comma tells the browser the payload is encoded rather than percent-escaped text, which is why some SVG data URIs carry readable markup and no base64 marker. The media type is a declaration, not a check — nothing verifies the bytes match it. Paste a bare payload with no prefix here and the type is worked out from the leading characters instead.

Is Base64 encoding the same as encryption?

No, and treating it as one is a real source of leaks. It is an encoding: a reversible mapping of arbitrary bytes onto sixty-four printable characters, so binary data can cross channels that only handle text, such as email bodies, JSON strings and HTML attributes. There is no key and no secret. Anyone holding the string can turn it back into the original file in seconds, which is what this page does. Base64 in a URL, a cookie or a config file protects nothing; it only stops someone skimming from reading it. Encrypt first if it matters, then encode the ciphertext.

Is it safe to paste a Base64 image into an online decoder?

The string never leaves your browser here. There is no upload and no request carrying it: once the text is checked it is handed to an image element on the page as a data URI, and the browser's own decoder draws it. The download link points at that same data URI, so saving writes bytes your machine already holds. That matters, because what people decode tends to be scanned documents, signatures and screenshots from private systems. The string itself still deserves care — it is the whole file, so any ticket you pasted it into holds a copy.

Should I embed images as Base64 in my HTML or CSS?

For very small assets, sometimes. Encoding costs roughly a third in size on top of the raw bytes, and an inlined image cannot be cached on its own, so every page load carries it again. That is tolerable for an icon that would otherwise cost a round trip, and it stops paying quickly above a few kilobytes. It is also why inlining fell out of favour once connection reuse made extra requests cheap. Email pulls the other way, since many clients block remote images, but data URI support there is patchy enough to test first.

How do I extract a Base64 image from a JSON response or a log?

Take the value of the field and nothing else — no surrounding quotation marks, no trailing comma. JSON allows a forward slash to be written escaped, and Base64 is full of forward slashes, so a payload lifted from a raw response often arrives peppered with stray backslashes that have to come out. Line breaks are harmless here, since whitespace is stripped before anything else, which covers strings wrapped at seventy-six characters by a mail encoder. Watch instead for an ellipsis inserted by a log viewer that abbreviates long values: that is corruption in the middle, and it is invisible.

Is a .jpeg file different from a .jpg file?

They are the same format, and every viewer opens both — jpg exists because old filesystems allowed only three letters. It matters here because the saved extension comes from the media type, and the registered type for a JPEG is image/jpeg, so that is the name you get. Rename it if a form insists on three letters. Renaming is where people come unstuck, though: calling a PNG .jpg does not convert anything, it mislabels the bytes, and strict software rejects it. Real conversion means decoding and re-encoding, with the trade attached — JPEG discards detail and holds no transparency.

Is a Base64 SVG safe to open?

Treat it more carefully than a bitmap. An SVG is XML rather than pixels, and it can carry script, external references and fonts. Loaded through an image element, as a preview is, script does not run and remote references are not fetched — a restriction browsers apply to images generally. The saved file is another matter: opening an .svg directly in a browser loads it as a document, where everything inside is live. Read the markup as text first if the source is not one you control. Being XML, the encoded string begins from an opening tag rather than a binary header.