Base64 to PDF Converter
Paste Base64, a data URI or a whole JSON response and see the PDF. Pages, version, title and a cut-off file are checked. PDF to Base64 too.
Loading tool…
How it works
Paste
Raw or URL-safe Base64, a data URI, text with line breaks, or JSON such as Page.printToPDF's result. Missing = padding is fine.
Check
Preview the PDF and see its pages, version, title and producer. A cut-off file, an encrypted one, an image or Base64 encoded twice is named.
Save
Download the PDF under its own name or title. To go the other way, choose PDF to Base64 and drop a file.
Which Base64 does it read?
The standard alphabet (+ and /) and the URL-safe one (- and _), with or without = padding, and with line breaks such as MIME's 76-character lines. Any other character is an error with its line and column.
How do I view a Page.printToPDF result?
Chrome DevTools Protocol's Page.printToPDF returns {"data": "..."} in Base64: paste the whole response. With transferMode ReturnAsStream, data is empty and the PDF is read with IO.read. Puppeteer's and Playwright's page.pdf() return bytes: paste Buffer.from(pdf).toString("base64").
How does it know the bytes are a PDF?
A PDF starts with %PDF- and its version, such as %PDF-1.7, and ends with %%EOF. The bytes are checked, not the data URI's label. Adobe's PDF Reference 1.7 says Acrobat accepts the header anywhere in the first 1,024 bytes, so a few bytes in front are flagged, not refused.
Why is my PDF cut off, or saved several times?
Every save ends in %%EOF. No %%EOF at the end usually means the file was cut short. An edited PDF can append its changes after the first %%EOF, so each incremental update adds one more. A Fast Web View file's extra %%EOF after its first page is not counted.
Printing pages to PDF in code?
Run your Playwright or Puppeteer scripts on Browser Use cloud browsers.