Base64 to File Converter
Turn Base64 text back into the original file. Paste a Base64 string or a data URI, and the file type is detected from the data itself. Images and text are previewed, and one click downloads the file with the right extension.
How to Convert Base64 to a File
Quick answer: paste the Base64 on the right; the file type and a preview appear in the middle. Press Download File.
-
1
Paste the Base64
Or a data URI, or open a .txt file.
-
2
Check the type
It is detected automatically.
-
3
Name the file
The extension is added for you.
-
4
Download
Get the original file.
What You Get
From Base64 Back to a File
Base64 text often hides a real file: an invoice in a web service response, an image in an email source, a document stored in a database field, or an attachment in a log. This tool decodes the text into the exact original bytes and lets you save them as a normal file you can open.
Automatic Type Detection
Files start with recognisable signatures, and the decoder uses them to identify PNG, JPG, GIF, WebP, BMP and SVG images, PDF documents, ZIP archives (which also covers Word, Excel and PowerPoint files), MP3, WAV and OGG audio, MP4 and WebM video, icons, XML, JSON and plain text. If you paste a data URI, its declared type is used as well. The suggested file name gets the matching extension.
Previews
Images are shown in the middle of the page so you can confirm you have the right picture, and text files show their content. For other types, the detected type and size are displayed. If nothing matches, the file is saved with a .bin extension; rename it if you know the real type.
Example
A support ticket includes a long Base64 block that is supposed to be a screenshot. Paste it here: the decoder detects a PNG image, shows the screenshot and suggests the name image-with today's date. Press Download File and you have the PNG.
Who Decodes Base64 Files?
Developers checking what a web service returned, support teams opening attachments from logs and tickets, testers verifying stored files, and anyone who received a file as text. Decoding in the browser means sensitive documents never leave your computer.
If Decoding Fails
Base64 contains only letters, numbers, + / and =, or - and _ in the URL-safe form. Spaces and line breaks are removed automatically. If you see an error, check that the whole text was copied, including the end, and that no other text, such as quotes or field names, is mixed in.
Related Tools
For images specifically, Base64 to Image shows the dimensions too. For PDFs, Base64 to PDF previews the first page. To encode a file, use File to Base64.
Everyday Scenarios
A developer checks a web service response that returns an invoice as Base64; pasting it here shows a PDF and lets them save it to confirm it opens correctly. A support agent finds a long Base64 block in an error log and discovers it is a screenshot of the problem. A database administrator exports a document stored in a text column and turns it back into a Word file. A tester verifies that an app stores attachments without damaging them by decoding a stored value and opening the result.
The decoded file is identical to the one that was encoded, so it opens in its usual program straight away.
Private, Free and Unlimited
Decoding happens entirely on your device. There is no sign-up, no watermark and no daily limit. Files are processed by your own browser and never leave your device, which makes the tool safe for contracts, photos, ID scans, client work and anything confidential. Close the tab and everything is cleared from memory. It works in current versions of the major browsers on Windows, Mac, Linux and Chromebooks, and on iPhone and Android for smaller files.
Restoring a File From Base64 Text
Files such as PDFs, spreadsheets and images can be written as Base64 text so that they pass safely through systems that only accept plain text. Decoding rebuilds the original file byte for byte.
Knowing what you have
Base64 does not record the file type. The first characters of the string tell you: JVBER is a PDF, UEsDB is a ZIP or an Office document, iVBOR is a PNG and /9j/ is a JPG. Choose a matching extension when saving.
Why it can fail
- The text is incomplete or has extra characters.
- The line breaks were changed during copying.
- The data is URL-safe Base64, which uses a hyphen and underscore.
Treat files from unknown sources with caution. To encode a file, use file to Base64.
Frequently Asked Questions
Questions about Base64 to file