How to convert a folder of Base64 files to images on a Mac
You can do this with B64 by dropping the folder in — it works out that you are decoding. Here is what comes back and how the names are restored.
Somebody has sent you a folder of text files, each one a Base64 payload. Or you exported a batch yourself and now want the pictures back. Either way the job is the same: a folder in, a folder of images out.
This guide covers batch decoding in B64.
A batch run happens entirely on your Mac. A thousand files are read from your disk, converted in the app and written back to your disk — nothing is uploaded, and the run works with the network switched off.
Decode a folder
Open Batch
Click Batch in the sidebar or press ⌘3.
Add the folder of payloads
Drag it in, or press ⇧⌘O. B64 sees text files holding Base64 and sets up a decode run — the direction tag beside the folder name says so.
Watch the thumbnails arrive
Each payload is decoded and shown with a thumbnail, its detected format and its size. This is where you find out whether a folder of payloads is what somebody said it was.
Save them all
Save All to Folder… writes every decoded image into a new folder, with the original file names restored automatically.
Names come back on their own
A payload exported as logo@2x.txt is saved as logo@2x.png — the name from the text file, and the extension from what the decoded bytes actually are. You do not rename anything by hand, and you do not end up with a folder of untitled-1 through untitled-400.
/Users/you/Downloads/payloads/ → /Users/you/Downloads/payloads-images/
├── logo@2x.txt ├── logo@2x.png
├── hero-banner.txt ├── hero-banner.jpg
├── signature.txt ├── signature.gif
└── press-kit.txt └── press-kit.pdfA payload whose data URI claimed PNG but whose bytes are a JPEG is saved as a JPEG. That is the only choice that produces files which actually open — see how to check the real format of a Base64 image.
What the payload files can contain
The same range that Decode accepts one at a time: a raw Base64 string, a data URI, or Base64 wrapped inside an HTML tag, a CSS rule or a Markdown reference. A folder of mixed forms decodes perfectly well.
Wrapping is not a problem either — payloads wrapped at 64 or 76 columns decode identically to unwrapped ones.
Checking individual results
- Double-click a row to open that payload in Decode, where you can Quick Look it and read its details.
- Select a row and press space to Quick Look it without leaving Batch.
- Right-click a row to save just that image, or reveal the source file in the Finder.
Anything that is not Base64
Reported as skipped, with the reason. A folder of payloads typically has a README or a manifest in it, and those are exactly the files that should be refused rather than turned into unreadable images. How to see which files were skipped.
Troubleshooting
It set up an encode instead
Batch judges by content. If the folder holds images as well as payloads, or the text files do not contain Base64, it may read the situation differently. Check the direction tag beside the folder name.
Some rows have no thumbnail
Those payloads decoded to something that is not an image. The characters were valid; the contents were not a picture.
A file decoded to a broken image
That payload was truncated before it reached you. Compare its character count against the source, or compare checksums with the manifest from the original export.
The saved files have the wrong extensions
They have the right ones. The extension comes from the decoded bytes, not from what a data URI in the file claimed.
Frequently asked questions
Are the original file names restored?
Yes. A payload exported as logo@2x.txt is saved as logo@2x with the extension its decoded bytes deserve.
Can the text files contain data URIs rather than raw Base64?
Yes, and they can also contain Base64 wrapped in HTML, CSS or Markdown. A folder of mixed forms decodes fine.
Does line wrapping in the payloads matter?
No. Wrapped and unwrapped Base64 decode to identical bytes.
What happens to non-Base64 files in the folder?
They are listed as skipped, with the reason — which is what you want for the README or manifest that usually sits alongside a folder of payloads.