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.
Input
Decoded file
Paste Base64 to decode it.
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 this page 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 this page 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.