Guide: Online PDF Viewer & Reader
↑ Back to toolWhat is this tool?
This online PDF viewer and PDF reader is a free tool that lets you view PDF files in your browser by pasting PDF data as Base64, Data URL (data:application/pdf;base64,...), or Hex. You can also upload a PDF file to view it. The tool auto-detects the input format when possible. The PDF is rendered in an iframe using a blob URL—no upload to a server. You can open the PDF in a new tab, download it, or copy the input. All viewing runs client-side; your PDF data is not sent to a server.
Why developers use this tool
Developers use an online PDF viewer to preview PDFs returned as Base64 or hex from APIs, stored in databases, or embedded in JSON/HTML. Instead of saving to a file and opening in a desktop app, you paste the bytes and view in the browser. This tool supports Base64, Data URL, and Hex so you can paste output from APIs, data URIs, or hex dumps. Upload a local PDF to view it without leaving the tool. Open in a new tab or download when you need to share or save. Useful for debugging API responses, inspecting stored PDFs, or quickly viewing a document.
- View PDFs from Base64, Data URL, or Hex without saving to disk
- Preview API responses or stored PDF data in the browser
- Upload a PDF file to view it in the same tool
- Open in new tab or download for sharing
Key features
- Base64 input — Paste raw Base64-encoded PDF bytes. The tool decodes and creates a blob URL for the browser to render.
- Data URL input — Paste a full Data URL (
data:application/pdf;base64,...). The tool extracts the Base64 part and displays the PDF. - Hex input — Paste PDF bytes as hexadecimal (e.g.
25504446...for%PDF). Useful when you have a hex dump from a tool or log. - Auto-detect — When enabled, the tool detects Data URL (starts with
data:application/pdf;base64,), Hex (hex chars and starts with255044for %PDF), or Base64 otherwise. - File upload — Upload a .pdf file. The tool reads it and displays it in the preview panel (and can show the bytes in the input panel for copy/paste).
- Open in tab — Open the current PDF in a new browser tab (same blob URL).
- Download — Download the PDF with a filename you choose (default
document.pdf). - Copy — Copy the current input (Base64/Data URL/Hex) to the clipboard.
- Sample — Load a minimal sample PDF to try the tool.
- 100% client-side — PDF data is decoded and rendered in your browser; your file is not uploaded to a server.
How this tool works (step-by-step)
- Choose input type — Select Base64, Data URL, or Hex (or leave Auto on so the tool detects from the content).
- Paste or upload — Paste PDF bytes in the left panel (Base64, Data URL, or Hex), or click Upload and select a .pdf file. Use Sample to load a minimal PDF.
- View — The right panel shows the PDF preview. The tool validates that the data starts with the PDF magic bytes (
%PDF); invalid data shows an error. - Open or download — Use Open in Tab to open the PDF in a new tab, or Download to save it with your chosen filename. Use Copy to copy the input string.
Real-world examples with code snippets
API returns PDF as Base64
Many APIs return a PDF in the response body as Base64. Copy the Base64 string (or the whole JSON field value), paste it into the left panel with Base64 selected, and the right panel shows the PDF. No need to decode and save to a file first.
Data URI from HTML or CSS
If you have a PDF as a Data URL (e.g. data:application/pdf;base64,JVBERi0x... from an embed or inline data), paste the full string and select Data URL. The tool strips the prefix and displays the PDF.
Hex dump from a debugger or log
If you have PDF bytes as hex (e.g. 255044462d312e340a...), select Hex and paste. The tool converts hex to bytes and displays the PDF. Valid PDFs start with 25504446 (%PDF in ASCII).
Use cases
| Scenario | How this tool helps |
|---|---|
| API response preview | Paste Base64/Data URL from an API response; view the PDF without saving to disk. |
| Stored PDF in DB or JSON | Copy the stored Base64 or hex string; paste and view in the browser. |
| Local file quick view | Upload a .pdf file to view it in the same interface; optionally copy the bytes for use elsewhere. |
| Hex / binary inspection | Paste a hex dump of a PDF; decode and view to verify content or debug encoding. |
| Download or open in tab | Download the PDF with a custom filename or open in a new tab for printing/sharing. |
Best practices
- Use the correct input type — Base64 is raw encoded bytes; Data URL includes the
data:application/pdf;base64,prefix. Hex is two hex digits per byte. Pasting the wrong type can cause “Invalid PDF” or garbled output. - Ensure valid PDF header — PDF files must start with
%PDF(bytes25 50 44 46). If you get “doesn’t start with %PDF”, the data may be truncated, wrong encoding, or not PDF. - Large PDFs — Very large PDFs may be slow to decode and render in the browser. Consider testing with a smaller file first.
- Don’t paste sensitive PDFs into shared links — If you share a URL that includes the PDF data in the hash, anyone with the link can see the content. Use with care for confidential documents.
Common mistakes & how to avoid them
- Invalid PDF: doesn’t start with %PDF — The decoded bytes don’t start with the PDF magic bytes. Check that you pasted complete Base64/Hex (no truncation), selected the right input type, and didn’t mix Base64 with Data URL (e.g. pasting Data URL while Base64 is selected can include the prefix as literal text in the decode).
- Data URL pasted as Base64 — If you paste
data:application/pdf;base64,...with Base64 selected, the tool tries to decode the whole string as Base64 and may fail or produce invalid bytes. Select Data URL or use Auto-detect. - Hex with spaces or wrong length — Hex input should be an even number of hex digits (0-9, a-f, A-F). Spaces are stripped. If you have an odd number of characters or non-hex characters, decoding can fail.
- Truncated paste — Very long Base64/Hex strings can be truncated when copying. Paste the full value; if the preview fails, try a shorter sample or re-copy from the source.
FAQ
What is an online PDF viewer?
A tool that displays PDF files in the browser. This one accepts PDF data as Base64, Data URL, or Hex—you paste or upload, and the PDF is rendered in the page. No server upload; everything runs in your browser.
What is the difference between Base64, Data URL, and Hex?
Base64 is the raw encoded string (e.g. JVBERi0x...). Data URL is data:application/pdf;base64, plus that string. Hex is the raw bytes as hexadecimal (e.g. 25504446... for %PDF). The tool supports all three and can auto-detect.
Is my PDF sent to a server?
No. The PDF is decoded and rendered in your browser using a blob URL. Your data is not uploaded. The tool is client-side only.
Why does it say Invalid PDF: doesn't start with %PDF?
PDF files must start with the bytes %PDF (25 50 44 46 in hex). The decoded input doesn't. Check that the string is complete, the correct format (Base64/Data URL/Hex), and actually PDF data.
Can I upload a PDF file?
Yes. Click the upload (folder) button and select a .pdf file. The tool reads it and displays it in the preview panel.
Can I open the PDF in a new tab?
Yes. When a PDF is loaded, use 'Open in Tab' to open it in a new browser tab. Useful for printing or viewing in full screen.
Can I download the PDF?
Yes. Use the Download button to save the current PDF. You can set the filename in the preview panel (default is document.pdf).
What is auto-detect?
When Auto is on, the tool detects the input format: Data URL (starts with data:application/pdf;base64,), Hex (hex chars and starts with 255044 for %PDF), or Base64 otherwise. You can still select Base64, Data URL, or Hex manually.
Is it free?
Yes. The tool is free with no sign-up. View, upload, open in tab, and download run in the browser.
Related terms
This tool is commonly searched as online PDF viewer, PDF reader, PDF viewer online, view PDF in browser, PDF base64 viewer, open PDF online, PDF preview, and free PDF viewer. It helps you view PDFs from Base64, Data URL, or Hex in the browser without installing software or uploading to a server.
Similar tools
You might also find these developer tools useful:
Conclusion
An online PDF viewer and PDF reader makes it easy to view PDFs from Base64, Data URL, or Hex—or from an uploaded file—without leaving the browser. This tool supports all three input formats, auto-detect, upload, open in tab, and download, all client-side. Use it for API responses, stored PDFs, hex dumps, or quick local file viewing; no server upload required.