Base64 → File Reconstructor
Paste a Base64 string or a data URI and get the original file back. The converter works out the real file type from the decoded bytes, so a PDF, image, ZIP, Word document, MP3 or anything else downloads with the right name and extension. Everything runs in your browser and nothing is uploaded.
How to convert Base64 to a file
- Paste the Base64 into the box. It can be a bare string, a full
data:URI, or a whole JSON, CSS or HTML snippet that contains them. For very large payloads, drop a.txtor.b64file instead of pasting. - The result appears as you type. Check the detected file type, the size and the preview.
- Rename the file if you want, then press Download. When there is more than one result, Download all as .zip bundles them.
If something is wrong with the input, the message says where instead of failing with a generic error, for example an invalid character at line 3, column 41.
It identifies the real file type from the bytes
Base64 carries no filename, and the label in front of it is often wrong. This converter ignores the label and reads the file signature at the start of the decoded data. It recognises common images (PNG, JPEG, GIF, WebP, AVIF, HEIC, BMP, ICO, TIFF, SVG), PDF, Office and OpenDocument files, EPUB, archives (ZIP, GZIP, 7z, RAR, TAR and more), audio and video, fonts, SQLite databases, and plain text including JSON, XML, HTML and PEM.
Office files are just ZIP archives underneath, so the converter reads the archive’s file list to tell a .docx, .xlsx or .pptx apart from an ordinary zip. If a paste says image/png but the bytes are really a PDF, you are warned and the file is saved as a .pdf.
Repairs the Base64 other decoders reject
Real-world Base64 is messy. The converter always accepts URL-safe Base64 (the - and _ variant), missing = padding, and text wrapped over many lines. With Try to repair damaged input switched on, which is the default, it also strips JSON escapes such as \n and \/, decodes %2B, %2F and %3D copied from a URL, and restores + signs that were turned into spaces. Email MIME parts and PEM blocks are unwrapped for you, and if the “Base64” turns out to be hexadecimal for a recognisable file, it is decoded as hex and you are told.
URL-safe Base64 is also what sits inside a JSON Web Token. To read the header and payload of a token, use the JWT decoder; to encode or decode ordinary strings, use the Text encoder / decoder.
Extract every embedded file from JSON, CSS or HTML
Switch to Find all to pull out every data URI and every long Base64 string from a pasted document: a JSON export where each key is a filename, a stylesheet full of inline background images, or an HTML page with embedded pictures. Each one becomes its own card, named from the JSON key or the URI’s name= parameter when there is one. A paste can yield up to 300 files, and they download together as one zip.
A minimum-length setting keeps short strings that only look like Base64 from being picked up by mistake. The extractor works on minified JSON too, but running it through the JSON formatter first makes it easier to see which key holds which file. The same name-to-data-URI JSON is what this tool exports from its own File to Base64 mode, so files round-trip.
Check the file before you save it
Open any result to see a preview of images, PDFs, audio and video (where your browser can play them), the first 20 KB of a text file, the contents list of a ZIP or Office file, the first 256 bytes as a hex dump, and the SHA-256 checksum. If you need a different algorithm, the Hash generator covers the rest.
Decoded content is never run or displayed as a web page. HTML is shown only as text, SVG only as an image, and executables and scripts are flagged so you do not open them by accident. The file itself can still be harmful, so only open files from sources you trust.
Turn a file back into Base64
Switch to File → Base64 to encode any file, not just images. Choose a data URI, raw Base64, URL-safe Base64, a MIME part with 76-character lines, or a JSON string, then copy it or save it as a text file. Several files can be exported together as one JSON map. Files up to 200 MB are accepted, though anything over 25 MB may make the tab pause for a moment.
If you only ever work with pictures, the Base64 image encoder / decoder is built for that. For a different alphabet, there is also a Base32 encoder / decoder.
Decoded a sprite sheet? Cut it without saving it first
Games often ship sprite sheets as Base64 inside a JSON or CSS file. When a decoded result is a PNG, JPEG, GIF, WebP, AVIF or BMP image, a Send to button appears under its preview and hands the image straight to the Sprite Sheet Cutter, ready to be split into frames.
Private by design
Decoding happens entirely in your browser. There is no upload, no account and no waiting for a server. Only your option toggles are remembered on your device; the text you paste is never stored. Decoding needs no network connection at all. The only thing that can be fetched is a small open-source zip library the first time you press the zip button.
Base64 to file: common questions
How do I convert Base64 to a PDF?
Paste the Base64 into the box. The converter recognises the PDF signature, shows a preview, and downloads the file with a .pdf extension. If your string starts with data:application/pdf;base64,, paste the whole thing; the prefix is handled for you.
Why does my Base64 string fail to decode?
The usual causes are a truncated string, an extra character at the start or end, quote marks or escape sequences copied from code, a mix of standard and URL-safe characters, or several Base64 strings joined together. The error names the character and its line and column. Leave Try to repair damaged input on to fix escapes and URL encoding automatically.
What is a data URI and can I decode one?
A data URI is Base64 with a label in front, such as data:image/png;base64,…. Paste it as it is. The label is read for the filename and MIME type, but the file type is always confirmed from the decoded bytes.
Is it safe to decode Base64 from an unknown source?
Decoding runs nothing and never renders the result as a web page, so pasting is safe. The file that comes out could still be harmful if you open it, so treat it like any download. Executables and scripts are marked with a warning.
Is there a size limit?
Live decoding works as you type up to about two million characters. Above that, press Decode now or drop the text as a file. The practical ceiling is your browser’s memory. Encoding a file to Base64 accepts up to 200 MB.