---
title: "Base64 to PDF: Decode, Preview and Check a PDF"
description: "Base64 to PDF converter: paste raw Base64, a data URI or CDP printToPDF JSON, preview the PDF, see pages and title, download it. Runs in your browser."
canonical: "https://browser-use.com/tools/base64-to-pdf"
last_updated: "2026-11-20"
---

# Base64 to PDF: Decode, Preview and Check a PDF

## 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.

## 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.

Source: [RFC 4648 §4 Base64](https://www.rfc-editor.org/rfc/rfc4648.html#section-4) · [§5 URL-safe](https://www.rfc-editor.org/rfc/rfc4648.html#section-5) · [RFC 2045 §6.8 line length](https://www.rfc-editor.org/rfc/rfc2045.html#section-6.8)

### 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").

Source: [CDP Page.printToPDF](https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) · [CDP IO.read](https://chromedevtools.github.io/devtools-protocol/tot/IO/#method-read) · [Puppeteer page.pdf](https://pptr.dev/api/puppeteer.page.pdf) · [Playwright page.pdf](https://playwright.dev/docs/api/class-page#page-pdf)

### 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.

Source: [ISO 32000-1 §7.5.2 header, §7.5.5 trailer](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf) · [PDF Reference 1.7, Appendix H note 13](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf)

### 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.

Source: [ISO 32000-1 §7.5.5 and §7.5.6](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf) · [PDF Reference 1.7, Appendix F](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf)

## Printing pages to PDF in code?

Run your Playwright or Puppeteer scripts on Browser Use cloud browsers.

[Automate with Playwright](https://browser-use.com/playwright)

PDF decoded, 1 page

Direction

Base64 to PDFPDF to Base64

Drop a PDF here

Choose a PDF

Encoded in your browser. Nothing is uploaded.

Base64, data URI or JSONJVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA0MjAgMjAwXSAvUmVzb3VyY2VzIDw8IC9Gb250IDw8IC9GMSA0IDAgUiA+PiA+PiAvQ29udGVudHMgNSAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1R5cGUxIC9CYXNlRm9udCAvSGVsdmV0aWNhID4+CmVuZG9iago1IDAgb2JqCjw8IC9MZW5ndGggMTE5ID4+CnN0cmVhbQpCVCAvRjEgMjQgVGYgNDAgMTIwIFRkIChIZWxsbyBmcm9tIEJhc2U2NCkgVGogRVQKQlQgL0YxIDEyIFRmIDQwIDkwIFRkIChBIG9uZS1wYWdlIFBERiwgZGVjb2RlZCBpbiB5b3VyIGJyb3dzZXIuKSBUaiBFVAplbmRzdHJlYW0KZW5kb2JqCjYgMCBvYmoKPDwgL1RpdGxlIChFeGFtcGxlIGludm9pY2UpIC9Qcm9kdWNlciAoYnJvd3Nlci11c2UuY29tIEJhc2U2NCB0byBQREYpID4+CmVuZG9iagp4cmVmCjAgNwowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCjAwMDAwMDAyNDEgMDAwMDAgbiAKMDAwMDAwMDMxMSAwMDAwMCBuIAowMDAwMDAwNDgxIDAwMDAwIG4gCnRyYWlsZXIKPDwgL1NpemUgNyAvUm9vdCAxIDAgUiAvSW5mbyA2IDAgUiA+PgpzdGFydHhyZWYKNTY5CiUlRU9GCg==

Load exampleOpen text fileClear

Decoded in your browser. Nothing is uploaded.

## PDF

Pages

1

PDF version

1.4

Size

784 B

Encrypted

No

Title

Example invoice

Producer

browser-use.com Base64 to PDF

Download PDFShow preview

Saves as Example invoice.pdf

No preview? Use Open in new tab.

---

BROWSER USE

- Browser Use Agents: give Browser Use a task and receive completed work. API V4 is current for new integrations.
- Browser Infrastructure: connect your agent or automation to managed browsers through SDK, REST, or CDP. Starts at $0.06/browser-hour.
- Developer tools: Open Source, Browser Harness, SDK, and MCP support the two products above.

[Developer Index](https://browser-use.com/index.md)
[Product Map](https://browser-use.com/llms.txt)
[Full Product Context](https://browser-use.com/llms-full.txt)
[Pricing](https://browser-use.com/pricing.md)
[Cloud Docs](https://docs.browser-use.com/cloud/quickstart)
[Open Source Docs](https://docs.browser-use.com/open-source/introduction)
