Base64 to PDF

Base64 to PDF turns a Base64 string — from an API response, database field or email source — back into a PDF file you can open and download. It also checks the result really is a PDF, converts Base64 PNG and JPEG images into a PDF, and works the other way round, encoding PDFs and other files to Base64. Everything runs in your browser.

How files start in Base64

TypeBase64 begins with
PDFJVBERi0
PNGiVBORw0KGgo
JPEG/9j/
GIFR0lGOD

When to use it

  1. Recover a PDF returned as Base64 by an API.
  2. Check a Base64 document field from a database or log.
  3. Encode a PDF for a JSON payload or test fixture.
  4. Turn a Base64 image into a PDF.

How to Use

  1. Paste Base64 or a data: URI.
  2. Check the detected type and size.
  3. Download the PDF — or drop files below to encode them.

Features

  1. Base64 and data: URI input
  2. URL-safe and unpadded Base64
  3. File type detection
  4. Truncation check
  5. Images to PDF
  6. PDF/file to Base64
  7. 100% client-side

FAQs

How do I convert Base64 to PDF?

Paste the Base64 string (with or without the data: prefix) and click Download PDF.

Why won't my Base64 decode?

It may be cut off or contain extra characters. The tool tells you if invalid characters are present or if the PDF looks truncated.

Can I convert a PDF to Base64?

Yes. Drop the file in the second section and copy the Base64 or data: URI.

Does it work with URL-safe Base64?

Yes. - and _ are handled automatically, and missing padding is added.

Is my file uploaded?

No. Decoding and encoding happen in your browser.

Technical Details

Pasted text is cleaned before decoding: a data: URI prefix is removed, whitespace and line breaks are stripped, URL-safe Base64 (- and _) is converted to standard Base64, and missing = padding is added, so strings copied from JSON, emails or logs decode without editing. Anything outside the Base64 alphabet is reported rather than silently dropped. The decoded bytes are identified from their first bytes — %PDF- for PDFs, the PNG and JPEG signatures for images — instead of trusting the string's label, and a PDF's version and whether it ends with %%EOF (a sign it wasn't truncated) are shown. PNG and JPEG images can be wrapped into a one-page PDF. In the other direction, any dropped file is encoded to Base64 in 32 KB chunks so large PDFs don't overflow the browser, optionally as a data: URI.

PDF Tools

PDF Tools

  • PDF to Image
  • PDF Text Extractor
  • PDF OCR
  • PDF to Word
  • PDF Merge
  • PDF Split
  • PDF Compressor
  • Bates Numbering for PDF