What is inside a PDF: 455 bytes you can type by hand
2026-12-04
A PDF is not a sealed binary. Most of it is text you can read, and a working one is short enough to type in Notepad. Once you have seen inside, every strange thing a PDF does makes sense.
Almost everything written about PDFs treats the file as a sealed box: you put a document in at one end, a tool does something unknowable, and a document comes out. That is a shame, because the format is unusually open about itself. Most of a PDF is plain text, and you can read it with the text editor already on your computer.
Here is the whole thing, and it is smaller than you expect.
A complete PDF, in 455 bytes
Open a plain text editor — Notepad, TextEdit in plain-text mode, anything that will not add formatting — and type this exactly:
%PDF-1.4
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 300 120] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
endobj
4 0 obj
<< /Length 56 >>
stream
BT /F1 24 Tf 40 50 Td (Hello from a text editor) Tj ET
endstream
endobj
5 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
trailer
<< /Root 1 0 R /Size 6 >>
%%EOFSave it as hello.pdf and open it. You get a small page with Hello from a text editor written on it.
That is a real PDF. Not a simplified teaching example — a file that opens in Acrobat, in your browser, and in the tools on this site.
Reading it back
Every numbered block is an object, and objects point at each other by number. 2 0 R means "object 2". That is the entire addressing system.
- Object 1, the catalog, is the way in. It says: the pages of this document are described by object 2.
- Object 2 is the page tree. One child, object 3.
- Object 3 is the page.
/MediaBox [0 0 300 120]is its size in points — 72 to the inch, so this page is about 10cm by 4cm. It says its content is in object 4 and the font it refers to as/F1is object 5. - Object 4 is the content. The only part that draws anything.
BTbegins text,/F1 24 Tfselects the font at 24 point,40 50 Tdmoves to a position measured from the bottom left of the page,(...) Tjdraws the characters,ETends. - Object 5 is the font, named rather than supplied, because every PDF reader is required to have Helvetica.
Then trailer says where to start, and %%EOF ends the file.
Read object 4 again, because it is the key to everything else on this page: the file does not say "a paragraph containing this sentence". It says "put these glyphs at coordinate 40, 50". A PDF is not a document in the sense a word processor means. It is a set of drawing instructions that happen to draw letters.
It is wrong in two ways, and it works anyway
Worth knowing, because it tells you how forgiving the whole ecosystem is.
The length is a lie. /Length 56 declares the content stream is 56 bytes. It is actually 54. Readers notice and carry on.
There is no cross-reference table. A proper PDF ends with an index listing the byte offset of every object, and a startxref pointing at it. This file has neither. It is, strictly, invalid.
Both versions were tested through pdf.js — the engine inside Firefox, and the one this site runs on — and both produced the same page: one page, 300 by 120, text reading Hello from a text editor. Readers rebuild what is missing rather than refusing the file.
Which is exactly why a damaged PDF is usually recoverable. The index at the end is the fragile part, and it is also the part that can be reconstructed by reading the objects from the top.
What a real PDF adds
Open something from your own disk in a text editor and it looks much less friendly. Two things account for nearly all of the difference.
Streams are compressed. The same page produced by a real library is 38 per cent readable text; the rest is deflate-compressed binary. The structure is still there — /Type /Page, /Filter /FlateDecode — but the content is packed.
Fonts are embedded. This is the one that surprises people, so here are measured numbers for the same single line of text on the same page:
- Typed by hand, naming Helvetica: 455 bytes
- Built by a library, naming Helvetica: 874 bytes
- With a real font embedded, subsetted to the characters used: 6,737 bytes
- With the same font embedded in full: 95,290 bytes
Twenty-four characters of text in a 93 KB file. The document carries the typeface so it looks the same on a machine that does not have it, and a full font is simply large. Subsetting — keeping only the glyphs actually used — is the difference between 6 KB and 93 KB, and it is why a one-page letter can refuse to compress below 300 KB no matter which setting you choose. There is no image to shrink. There is a typeface.
What this explains
Nearly every PDF frustration is this structure showing through.
Text will not reflow when you edit it. There are no paragraphs to re-wrap, only glyphs at coordinates. Change a word and nothing moves aside, because nothing knows the words are related. That is the whole reason editing a PDF is four different jobs rather than one.
A black rectangle hides nothing. Drawing a filled rectangle adds an instruction to object 4. The (...) Tj holding the name underneath is untouched, still in the file, still selectable, still searchable. This keeps reaching the news, and now you can see exactly why.
Your name is in there. Metadata is just another object, carrying author, producer, dates, sometimes the original file path. Nothing displays it, and it travels with the file — which is more than most people expect to send.
A scan has no text at all. Photograph a page and the content stream holds one instruction: draw this image here. There is no Tj, no characters, nothing to search. OCR adds the text layer that was never there.
And nothing in that file needed a server. Every operation on a PDF is a transformation of objects like these — copying them between files to merge, dropping them to delete pages, rewriting an image object to compress. It is ordinary work on an ordinary data structure, which is why it can all happen in your browser and why a tool that insists on uploading your document is making a choice rather than meeting a requirement.
Looking inside your own
Safely, in three steps.
- Work on a copy. A text editor can save a PDF in a way that breaks it, especially one that rewrites line endings.
- Open the copy in a plain text editor. Expect mostly noise with readable structure threaded through it.
- Search for what interests you.
/Type /Pageappears once per page./Producerand/Authorname the software and sometimes you./Filtertells you how a stream is packed./Encryptmeans the file is protected./JavaScriptin a document that has no business running code is worth a pause.
If you only want the words, PDF to Text extracts them without the archaeology. If you want the hidden parts gone before you send it, Remove hidden data strips metadata, scripts, attachments and annotations in one pass.
The short version
- A PDF is a list of numbered objects that reference each other, and most of it is readable text.
- A complete working one fits in 455 bytes and can be typed by hand.
- It stores glyphs at coordinates, not paragraphs — which is why text does not reflow and why covering something does not remove it.
- Real files differ by compressing their streams and embedding fonts; a full font can be 93 KB for one line of text.
- The index at the end is the fragile part, and the part a repair tool rebuilds.
- Open a copy of one in a text editor. It is the fastest way to stop guessing.
See what your own file is carrying
Now that you know what is in there: metadata, scripts, attachments and annotations come out in one pass, on your own device, with nothing uploaded.
Free, no account, no watermark — and the file never leaves your device.