Start Here

How to convert Base64 to an image on a Mac

You can do this with B64, free and forever, on your own machine. Here is how to paste a payload in, what the app accepts, and how to save or copy the picture that comes out.

Someone has sent you a wall of characters and told you it is an image. It might be a raw string, it might start with data:image/png;base64,, it might be sitting inside an HTML tag you copied out of a page. You want to see what it is — and you would rather not paste an unknown payload into a website to find out.

Decoding in B64 is free forever: no purchase, no account, no time limit. This guide covers what you can paste, what appears, and what you can do with the result.

Note

Every conversion happens on your Mac, inside the app. Nothing is uploaded, there is no account, and no usage is reported — which matters if the picture holds a customer's details, an unreleased asset or a signed document.

Decode a Base64 string

  1. Open the Decode workspace

    Click Decode in the sidebar, or press ⌘2. It says Base64 → Image under its title.

  2. Put the Base64 in

    Click Paste in the toolbar, or type or paste directly into the input box. You can also Import… a .txt file that contains Base64, or drop that file straight onto the input box.

  3. Read the result

    The picture appears next to the input as you type, along with its detected format, its dimensions and its size. There is no decode button — valid input simply becomes a picture.

  4. Keep it

    Quick Look shows it full size. Copy Image puts it on the clipboard for the next app. Save… writes it to disk exactly as decoded, with the right extension for what the bytes actually are.

What you can paste

You do not have to trim the payload out of whatever you found it in. B64 looks inside the common wrappers and decodes what it finds.

Accepted Base64 input forms
You pasteExampleResult
A raw stringiVBORw0KGgoAAAANSUhEUg…Decoded
A data URIdata:image/png;base64,iVBORw0…Decoded, MIME type read
An HTML image tag<img src="data:image/png;base64,…">Payload found inside and decoded
A CSS rulebackground-image: url("data:…")Payload found inside and decoded
A Markdown image![shot](data:image/png;base64,…)Payload found inside and decoded

Whitespace and line breaks are not a problem either. A payload that was wrapped at 64 or 76 columns on its way to you decodes exactly like an unwrapped one — see line wrapping for why it was wrapped in the first place.

When the type is not what it says it is

A data URI declares a MIME type, and that declaration is sometimes wrong — a PNG header re-labelled as a JPEG on its way through some pipeline. When the declaration and the bytes disagree, B64 shows a short note and trusts the bytes, because the bytes are the file.

The Inspector (⌥⌘I) shows both values side by side, so you can see exactly what the payload claimed and what it really is. Save it and it is saved with the extension its bytes deserve, not the one it was advertised under.

Why this matters

A mislabelled data URI often works in one place and fails in another — a browser sniffs the bytes and renders it, while a stricter consumer rejects it on the declared type. Finding out here is cheaper than finding out in production.

Very large payloads

A multi-megabyte string is held and decoded whole. What changes is the display: rather than rendering millions of characters into a text view, the input is shown in pages behind a View Text… button, and the summary tells you how much is loaded. The decode itself always runs on the complete text.

Pasting or importing at that size stays responsive, and the picture appears when the bytes are ready rather than after a spinner you cannot cancel.

When nothing appears

Invalid input gets an inline note rather than a dialog — the message sits next to the input so you can fix it and watch it resolve. The usual causes, in the order they actually happen:

  • A partial copy. The single most common cause. A payload cut off mid-string cannot decode; go back and copy all of it.
  • It decodes, but not to a picture. Valid Base64 of something that is not an image or a PDF has nothing to show. The characters were fine; the contents were a zip, or a text file, or anything else.
  • Stray characters from a chat or a mail client. Quotation marks that were turned into curly ones, or a trailing ellipsis where something was abbreviated for display.
  • URL-safe variants. A payload using - and _ in place of + and / is a different alphabet from the standard one.

There is a fuller walk-through in what to do when Base64 will not decode.

Decoding a lot of files

If you have a folder of .txt files that each hold a Base64 payload, use Batch (⌘3). Drop the folder in, B64 works out that you are decoding, and every file becomes an image again — with thumbnails, and with the original names restored on save.

What else you can do here

  • Check it against the original. The Inspector gives you a SHA-256 of the decoded bytes — compare it with the checksum of the file it was made from.
  • Look at it properly. Quick Look renders at full resolution, which is how you spot that a payload is the low-resolution version.
  • Send it onward. Copy Image drops it straight into the next app without touching the disk.

Frequently asked questions

Is decoding really free?

Yes, forever, with no purchase and no account. Encoding images to Base64 and batch conversion are the paid features; turning Base64 back into a picture is not.

Do I have to strip the data URI prefix first?

No. Paste the whole thing, prefix and all. The same is true of an HTML img tag, a CSS url rule or a Markdown image reference — the payload is found inside.

Where does the decoded image go?

Nowhere, until you say so. It is shown in the window; Save writes it to the location you choose and Copy Image puts it on the clipboard. Nothing is written to disk on your behalf.

What if the Base64 is not an image at all?

Then there is nothing to display. Valid Base64 can encode any file, and B64 shows a picture only when the decoded bytes actually are one.

Can I decode a whole folder of Base64 files at once?

Yes. Drop the folder into Batch and it sets up a decode run, restoring the original names when you save.