Encoding Tools
Base64 to image, PDF or file.
Paste a Base64 string or a data: URI and get the file back. The type is identified from the file's own bytes, images are previewed, and you can download the result. Nothing leaves your browser.
How to decode Base64 to a file
- Paste a Base64 string or a data: URI into the box.
- The decoder identifies the file type from its own bytes and shows a preview if it is an image.
- Download the decoded file.
Why it checks the bytes
Base64 writes binary data as plain text so that it can travel through JSON, email, HTML and APIs. The decoder does not trust a file name or the media type in a data URI. It looks at the first bytes for known signatures, such as 89 50 4E 47 for PNG, FF D8 FF for JPEG and 25 50 44 46 for PDF, and names the type accordingly. That protects you from a file that claims to be one thing and is actually another.
Decoding is safe, but opening what you decode is up to you. A decoded file can still be an executable or a document with active content, so treat it like any download from an unknown source. Whitespace and line breaks inside the Base64 are ignored.
Decoded on your device
The decoder runs in your browser, inside an isolated frame on this page that has no network access. Your file is read and written back by your own device, so it is not uploaded to TNAADO or anyone else, and nothing is stored. The advertising on this page sits outside the frame and cannot see what you choose. Strings often contain private documents or credentials, so nothing is uploaded.
- Very long strings can slow the browser; paste only what you need.
- URL-safe Base64 variants are accepted.
About this Base64 to file decoder
Base64 writes binary data as plain text so it can travel through JSON, email, HTML and APIs. This tool reverses it: it turns the text back into the original bytes, works out what kind of file they are, and lets you download them.
How the type is detected
The decoder does not trust a file name or the MIME type in a data URI. It checks the first bytes of the decoded data for known signatures: 89 50 4E 47 for PNG, FF D8 FF for JPEG, %PDF- for PDF, PK for ZIP, GIF8, RIFF…WEBP and others. If the data is text it is recognised as SVG, JSON or plain text. When a data URI declares one type and the bytes show another, the page tells you.
Common inputs
- A full data URI such as
data:image/png;base64,iVBOR…: the prefix is removed for you. - An API field that returns
"content": "JVBERi0x…"(a PDF starts withJVBERi): paste only the value, without the quotes. - URL-safe Base64 (
-and_instead of+and/), as used in JWTs and many web APIs.
Errors you may see
- Invalid character: the message names the character and its position. Quotes, commas and
\nescapes copied from JSON are the usual cause. - Invalid length: a Base64 string cannot end with exactly one leftover character. The text was probably cut off when copied.
Privacy and limits
Decoding happens in your browser, and the isolated tool frame loads no advertising or analytics scripts. Image previews use a local object URL, so SVG files are displayed as images and cannot run script. Decoded size is capped at 25 MB.
FAQ
How do I convert Base64 to a PDF?
Paste the Base64 string. If it decodes to a PDF (it usually starts with JVBERi) the page reports application/pdf and offers Download decoded.pdf and Open PDF.
How do I turn a Base64 string into an image?
Paste it, with or without the data:image/…;base64, prefix. The image is previewed and you can download it with the right extension.
Is the data uploaded anywhere?
No. Decoding and preview run locally and the isolated tool frame includes no ad or analytics code.
Source
- RFC 4648, The Base16, Base32, and Base64 Data Encodings: rfc-editor.org/rfc/rfc4648, sections 4 and 5.
- RFC 2397, The "data" URL scheme: rfc-editor.org/rfc/rfc2397.
Worked example: recognising a PDF and a PNG from their first bytes
The decoder ignores the file name and any MIME type in a data URI, and looks at the decoded bytes instead.
| Base64 input | First decoded bytes | Detected as |
|---|---|---|
| JVBERi0xLjQK | 25 50 44 46 2D 31 2E 34 0A, the text "%PDF-1.4" | |
| iVBORw0KGgo= | 89 50 4E 47 0D 0A 1A 0A | PNG (the 8-byte PNG signature) |
| SGVsbG8sIHdvcmxkIQ== | 48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 | Plain text: "Hello, world!" |
A real PDF in Base64 begins with JVBERi and a PNG with iVBORw0KGgo, which is a quick way to spot what a long string contains.
Next steps: data URI generator, Base64 text encoder, image tools, or JWT decoder.