Convert Base64 to PDF
Paste Base64 data or a PDF Data URI to validate, preview and download the decoded PDF — directly in your browser.
ⓘ Nothing to convert yet
Nothing to convert yet — paste your data or drop a file to begin.
Inspection Report
- Detected Type
- —
- MIME Type
- —
- Encoding
- —
- Input Length
- —
- Decoded Size
- —
- Padding Status
- —
- Data URI
- —
- File Signature
- —
- Preview Availability
- —
How to convert Base64 to PDF
To convert Base64 to PDF, paste your Base64 string or PDF Data URI into the tool above. It validates the data, checks the %PDF- file signature, and shows a preview of the decoded document. You can then download it as a .pdf file — all processing happens locally in your browser, with nothing uploaded.
How to Use
- Paste your Base64 string into the input box. A full Data URI (data:application/pdf;base64,...) works too — the prefix is detected and removed automatically.
- The tool validates the Base64 and decodes it. If padding is missing or URL-safe characters are found, use the one-click fix.
- Check the inspector: it confirms the %PDF- file signature, MIME type and decoded size.
- Preview the PDF inline to make sure it is the document you expected.
- Click Download to save the .pdf file, or Copy to grab the cleaned Base64.
Real Example
The Base64 string JVBERi0xLjQK decodes to the bytes %PDF-1.4 followed by a newline — the opening of a real PDF document. When you paste a complete PDF's Base64, the inspector reports Detected Type: PDF, MIME: application/pdf, File Signature: %PDF-, plus the exact decoded size (for example 327 KB), and the preview renders the first page before you download anything.
Code Snippets
// Decode Base64 to a PDF and trigger a download (browser)
const bytes = Uint8Array.from(atob(base64), c => c.charCodeAt(0));
const blob = new Blob([bytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);
const a = Object.assign(document.createElement('a'), { href: url, download: 'document.pdf' });
a.click();
URL.revokeObjectURL(url);How Base64 to PDF Works
PDF files always begin with the five bytes %PDF-, which makes them easy to identify after decoding. This tool decodes your Base64 into raw bytes, reads the file signature from those bytes — not from any Data URI label, which can lie — and only then offers the preview and download. If the decoded bytes start with something else, for example the PNG signature, you get a clear "not a PDF" message instead of a broken file. Because decoding uses your browser's own routines, even multi-megabyte documents are processed locally and never leave your device.
Common Use Cases
- Opening a PDF that an API returned as a Base64 field in a JSON response.
- Verifying a Base64 PDF payload from a webhook before storing it.
- Extracting a document embedded as a Data URI in an HTML or XML file.
- Double-checking that a Base64 string really contains a PDF and not a renamed image.