Base64 to PDF
Decode any Base64 string or PDF Data URL back into a real PDF file. Validates the %PDF signature, shows decoded file size, and supports download — all in your browser.
Paste a Base64 string or PDF Data URL above, then click Decode PDF
Have a PDF to encode?
Convert a PDF file to Base64, JSON payload, or a ready-to-use cURL command.
How to Decode Base64 to PDF
Paste Base64
Paste a raw Base64 string or a full PDF Data URL (data:application/pdf;base64,...). The prefix is auto-detected and stripped.
Click Decode PDF
The tool decodes the Base64 data and checks whether the file starts with the %PDF signature to confirm it is a valid PDF.
Download
Click Download PDF to save the reconstructed file to your device. The decoded file size is shown before you download.
When Do You Need to Decode Base64 to PDF?
Common scenarios where you receive a Base64-encoded PDF and need to recover the original file.
Inspect API Responses
Many document-generation and e-signature APIs return PDFs as Base64. Paste the value to quickly verify and download the file.
Recover Stored PDFs
Decode PDF data retrieved from a JSON database, localStorage, or other Base64-encoded storage back into a downloadable file.
Debug File Upload Pipelines
During development, verify that a Base64-encoded PDF round-trips correctly by decoding it and inspecting the result.
Extract Email API Attachments
Services like SendGrid and Mailgun include email attachments as Base64 in their responses. Decode to recover the original PDF.
Frequently Asked Questions
What input formats are supported?
Raw Base64 strings and full PDF Data URLs (data:application/pdf;base64,...) are both accepted. URL-safe Base64 (using - and _ instead of + and /) is also handled automatically.
How do I get the Base64 PDF from an API response?
JavaScript: const b64 = responseJson.data. Python: b64 = response.json()['data']. The exact field name depends on the API. Paste only the Base64 value, not the entire JSON.
Why validate the %PDF signature?
The PDF specification requires all PDF files to start with the ASCII string %PDF. Checking the first 4 bytes of the decoded data confirms the Base64 string really represents a PDF and has not been truncated or corrupted.
Can I preview the PDF without downloading it?
This tool focuses on decoding and downloading. For an inline preview, copy the Data URL output from the PDF to Base64 tool and paste it as the src of an <object> or <iframe> in your browser’s developer console.
The downloaded file is corrupted — what’s wrong?
The most common cause is spaces or newlines inserted into the Base64 string. The tool strips whitespace automatically. If the problem persists, check that the Base64 string is complete — a truncated input produces an incomplete file.
Is the file uploaded to a server?
No. All decoding is done in the browser via the atob() API — no data is sent anywhere. You can even go offline and the tool still works.