Minimal Valid PDF File: Smallest PDF Bytes in Hex & Base64 for Testing
Copy the smallest valid PDF in hex or base64. Minimal valid pdf file bytes hex and base64 pdf for testing parsers, APIs, and viewers. Paste into our free PDF viewer to preview.
📄 Smallest Valid PDF in Hex & Base64—Copy, Paste, Test
Developers often search for minimal valid pdf file bytes hex, smallest valid PDF, or base64 pdf to test viewers, parsers, or APIs. Below you’ll find a minimal valid PDF—the shortest byte sequence that still opens as a valid PDF—in both hex and Base64. Paste either into our free PDF viewer to preview it in the browser. No sign-up; client-side only.
What is a Minimal Valid PDF?
A minimal valid PDF (or smallest valid PDF) is the shortest sequence of bytes that still conforms to the PDF specification and opens in standard viewers. It must include a header (%PDF-1.4), a catalog, at least one page, a cross-reference table, and a trailer. The example below is one such file: a single page with the text "Hello, PDF!"—often used for testing base64 pdf pipelines or minimal valid pdf file bytes hex in parsers and validators.
Smallest PDF vs practical minimal PDF
Search results often talk about the smallest PDF, but there are two different goals. One goal is a byte-golf example that tries to remove every optional byte and may depend on forgiving viewers. The more useful goal for developers is a practical minimal valid PDF: small enough to copy into tests, but complete enough to exercise real parser behavior. The sample on this page favors the practical version.
That means the file includes ordinary PDF structure instead of relying on obscure viewer tolerance. You can use it as a stable fixture for upload APIs, Base64 decode paths, PDF preview components, file-type checks, and smoke tests. It is intentionally tiny, but it is not meant to represent encrypted PDFs, forms, annotations, embedded files, signatures, scanned pages, or modern compressed object streams.
What bytes make this PDF valid?
| PDF part | Why it matters | What to look for |
|---|---|---|
| Header | Identifies the file as PDF | %PDF-1.4 |
| Catalog | Root object that points to document pages | /Type /Catalog |
| Pages tree | Declares the page list and count | /Type /Pages |
| Page object | Defines media box, resources, and content stream | /Type /Page |
| xref and trailer | Let readers locate objects reliably | xref, trailer, startxref |
Minimal Valid PDF in Hex (Smallest Valid PDF Bytes Hex)
Paste this hex string into our PDF viewer with Hex selected to view the minimal PDF. Valid PDFs start with 25504446 (%PDF in ASCII).
255044462d312e340a312030206f626a0a3c3c202f54797065202f436174616c6f67202f5061676573203220302052203e3e0a656e646f626a0a322030206f626a0a3c3c202f54797065202f5061676573202f4b696473205b33203020525d202f436f756e742031203e3e0a656e646f626a0a332030206f626a0a3c3c202f54797065202f50616765202f506172656e74203220302052202f4d65646961426f78205b30203020363132203739325d202f436f6e74656e7473203420302052202f5265736f7572636573203c3c202f466f6e74203c3c202f4631203520302052203e3e203e3e203e3e0a656e646f626a0a342030206f626a0a3c3c202f4c656e677468203434203e3e0a73747265616d0a42540a2f46312032342054660a313030203730302054640a2848656c6c6f2c20504446212920546a0a45540a656e6473747265616d0a656e646f626a0a352030206f626a0a3c3c202f54797065202f466f6e74202f53756274797065202f5479706531202f42617365466f6e74202f48656c766574696361203e3e0a656e646f626a0a787265660a3020360a303030303030303030302036353533352066200a30303030303030303039203030303030206e200a30303030303030303538203030303030206e200a30303030303030313135203030303030206e200a30303030303030323730203030303030206e200a30303030303030333633203030303030206e200a747261696c65720a3c3c202f53697a652036202f526f6f74203120302052203e3e0a7374617274787265660a3434330a2525454f460a
Minimal Valid PDF in Base64 (Base64 PDF)
Same minimal valid PDF as base64 pdf. Paste into the PDF viewer with Base64 selected.
JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSAvQ29udGVudHMgNCAwIFIgL1Jlc291cmNlcyA8PCAvRm9udCA8PCAvRjEgNSAwIFIgPj4gPj4gPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCA0NCA+PgpzdHJlYW0KQlQKL0YxIDI0IFRmCjEwMCA3MDAgVGQKKEhlbGxvLCBQREYhKSBUagpFVAplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1R5cGUxIC9CYXNlRm9udCAvSGVsdmV0aWNhID4+CmVuZG9iagp4cmVmCjAgNgowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCjAwMDAwMDAyNzAgMDAwMDAgbiAKMDAwMDAwMDM2MyAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDYgL1Jvb3QgMSAwIFIgPj4Kc3RhcnR4cmVmCjQ0MwolJUVPRgo=
How to Use These Bytes
- Test our PDF viewer — Open PDF viewer, choose Hex or Base64, paste the string above, and preview the minimal PDF.
- Test APIs — Send the Base64 (or decode hex to bytes) in request bodies to test PDF handling.
- Parser / validator tests — Use as fixture input for unit tests or validation scripts.
Good test cases for a minimal PDF fixture
A tiny PDF is most useful when you need a known-good binary payload without carrying a large document in a repository. It is especially handy for tests where the PDF contents do not matter and the only requirement is that the bytes are recognizably valid.
- Upload endpoints — Confirm that an API accepts a PDF MIME type, stores the file, and returns a success response.
- Base64 pipelines — Decode a Base64 PDF string, write bytes to disk or object storage, and confirm the result still opens.
- File signature checks — Verify that validators recognize the
%PDFheader and do not confuse the fixture with plain text. - Viewer smoke tests — Make sure a browser preview, embedded iframe, or server-side thumbnail service can load at least one simple page.
What this sample should not test
Do not use a minimal PDF as your only fixture for a production PDF feature. It will not reveal problems with large files, image-heavy pages, embedded fonts, password protection, broken xref tables, incremental updates, digital signatures, or unusual encodings. Keep this tiny file for smoke tests, then add realistic PDFs for the workflows your users actually upload.
Minimal PDF FAQ
Can I paste the Base64 string directly into JSON?
Yes. Put the Base64 PDF inside a JSON string value, then decode it on the receiving side before writing bytes or sending it to a PDF viewer.
Why does my viewer reject a smaller PDF from another site?
Some ultra-small examples rely on parser leniency. A practical fixture with catalog, page tree, xref, and trailer is more reliable across browsers and libraries.
Should the MIME type be application/pdf?
Yes. When uploading or serving the decoded file, use application/pdf so browsers and APIs handle it as a PDF.
Related Tools
PDF viewer — View PDF from hex or Base64 in the browser. Base64 — Encode/decode text or binary. Hex decoder — Convert hex to bytes or text.
✅ View the Minimal PDF in Your Browser
Paste the minimal valid pdf file bytes hex or base64 pdf above into our free PDF viewer to preview. No upload; all client-side.
Related Articles
curl Diff Checker Online — Diff Two curl Commands Side by Side
Free curl diff checker online: paste two curl commands and see header, URL, auth, and body differences. Use Spoold curl Compare as your curl diff tool—client-side, no upload.
Compare curl Requests Online — Side-by-Side HTTP Request Diff
Compare curl request online: paste two HTTP curls from DevTools or Postman and diff method, URL, headers, auth, and body. Free Spoold curl Compare—no upload.
Find the curl Difference: Headers, Auth, and Body Side by Side
Find the curl difference between two requests—Authorization, headers, query, and JSON body. Use Spoold curl Compare to spot token drift and payload changes online.