Where a PDF's file size actually comes from

By Filewhisk Team Published Updated

Two PDFs taken apart object by object, then compressed - and why the same tool shrinks one by 96% and the other by 13%.

“Compress PDF” is the most disappointing button on the internet. Sometimes an 8 MB file becomes 400 KB; sometimes a 2 MB file comes back at 1.9 MB and you assume the tool is broken. It usually is not. The outcome is decided before you press anything, by what is inside the file.

Two files, taken apart

We measured two PDFs object by object — every numbered object in the file, sorted by what it holds.

File A: a photographed page. A 15.9-megapixel photo turned into a one-page A4 PDF, which is what you get when you photograph or scan a document. Total: 9,208,534 bytes.

What it isBytesShare
Image data9,207,711100.0%
Page content streams7760.0%
Cross-reference table and trailer470.0%

File B: a real text form. The IRS Form W-9 as published by the IRS (fw9.pdf), 140,815 bytes, six pages of text, rules and form fields — no photographs at all.

What it isBytesShare
Content streams (the text and lines on each page)125,37089.0%
Other objects (fonts, form fields, structure)13,6449.7%
Page dictionaries1,6061.1%
Images00%

Now compress both

Both files went through the same tool — Compress PDF on this site, which resizes and re-encodes images and leaves everything else alone:

FileSettingResultChange
A — photographed page (9.21 MB)Light (300 DPI)3.47 MB−61%
Recommended (150 DPI)390 KB−96%
Strong (96 DPI)140 KB−98%
B — text form (137.5 KB)Recommended120.3 KB−13%

Same tool, same settings, results two orders of magnitude apart. File A was 100% image, so shrinking images shrank the file. File B had no images, so the only saving came from re-writing the file's structure — and 13% is roughly the ceiling for that.

The rule

A PDF is only as compressible as the pictures inside it. Before you try to compress, work out which kind of file you have:

If you want the exact answer rather than the rule of thumb, Extract Images from PDF pulls out every embedded image with its original size. Add them up: that is the part that can shrink.

Why DPI is the setting that matters

Image compression in a PDF is not really about quality sliders. It is about resolution: how many pixels are stored for each inch of printed page. A phone photo of an A4 sheet arrives at roughly 400–600 DPI, which is far more than either a screen or an office printer can show.

TargetSensible DPIGood for
Light300Archiving, professional printing, documents you may need to enlarge
Recommended150Email, uploads, office printing — sharp on screen and on paper
Strong96Screen-only reading, hard upload limits; visibly softer when printed

This is also why the 96% result above is not a trick: going from ~570 DPI to 150 DPI throws away about 93% of the pixels before a single byte of image compression happens.

Things that do not shrink a PDF (much)

When a scan really has to be small

For a scanned document heading into an upload form with a hard limit, the order that works is: compress at Recommended first, check the size, and only then go to Strong. Going straight to the strongest setting usually produces a file far under the limit and harder to read than it needed to be — in our test, Strong landed at 140 KB when the form would have accepted 390 KB.

If the document is a single photographed page, there is a second route worth knowing: shrink the photo first and build the PDF from it with JPG to PDF. You get the same control over the result, and the page is built once rather than encoded twice.

What compression does not change

Text stays text. A well-built compressor re-encodes the images inside the pages and leaves the text layer, links, bookmarks and form fields alone — so a compressed file is still searchable and selectable. If a tool returns a PDF whose text you can no longer select, it has flattened your pages into pictures to hit a number. That is a different operation, it is irreversible, and it is worth checking the result before you send it anywhere.

Tools used in this guide