Skip to content
โ—ˆCompressInKB

How PDF compression actually works (and why most "compressors" are guessing)

By CompressInKB8 min read937 words

"Compress this PDF" is really four different operations wearing one name. Knowing which one you need explains why the same file compresses brilliantly on one tool and hardly at all on another.

Mechanism one: structural dead weight

A PDF is an object graph: pages reference content streams, which reference resources. Some edited files contain unused or redundant objects. Rewriting can reduce overhead in some documents, but it is not a guarantee that every unused or hidden object is removed.

Document properties and XMP can also describe a file. This site resets several common Info fields, but XMP, attachments and other hidden material may remain. Use a specialist inspection or redaction process where privacy matters.

A structural rewrite avoids rendering pages as pictures. Whether it saves space depends on the original PDF; if the attempted rewrite grows the file, this tool keeps the original. Verify forms, links and signatures after any rewrite.

Mechanism two: image re-encoding

In a scanned document, images are 90โ€“98% of the bytes. Each page is stored as a JPEG (or a CCITT/Flate bitmap for black-and-white scans), and the encoder that produced it optimised for something other than your file-size limit.

Re-encoding is where the real savings live โ€” and where the damage is done if you simply apply a fixed quality. A fixed quality 50 might take one scan from 2 MB to 180 KB and leave another at 900 KB, because images differ wildly in how much detail they carry.

Some image compressors search quality settings against a target, but file size is not a perfect proxy for readability and a target may be impossible. This PDF compressor does not individually optimise every embedded image: its optional rebuild renders each page as a JPEG and checks the resulting PDF size.

Mechanism three: resolution

When even the lowest acceptable quality overshoots โ€” say a 300 dpi colour scan of twenty pages targeting 100 KB โ€” the only remaining lever is pixel count. Halving both dimensions quarters the data.

This is usually the better trade than pushing quality to the floor. A 150 dpi scan at quality 70 reads better than a 300 dpi scan at quality 15, because JPEG artefacts damage thin strokes far more than a modest reduction in resolution does. Screens are about 100โ€“150 dpi in effective terms anyway; 300 dpi is for printing.

A good compressor makes this decision explicitly and tells you the resolution it settled on. A bad one silently turns your document into soup.

Mechanism four: rasterising (and its cost)

At the extreme, a tool can render each page to an image and rebuild the PDF from those images. This is enormously effective โ€” a text page becomes a single JPEG and the entire font program, content stream and vector data disappear.

The cost is real and permanent: the output has no selectable text, no searchable text, no accessibility tree, and text stops scaling cleanly when printed. For a scanned document this costs nothing (the page was already an image). For a text document it destroys the very thing that made it compact.

On this site, structure-only mode avoids this trade-off. Automatic mode may rebuild pages when the structural result remains above the target; the selector warns about the loss of selectable text, and the result card describes the result.

The two cases where nothing helps

First: a file that is already optimally compressed. If a PDF has been through a good compressor once, the structural fat is gone and the images are already tuned. Expect single-digit gains, and do not let a tool tell you otherwise without showing you the byte count before and after.

Second: encryption. A password-protected PDF cannot be re-encoded without decrypting it, and a tool that silently does so is doing something you did not ask for. Remove the password yourself and then compress.

How the search works, and why the reported number is honest

The PDF rebuild samples pages to estimate a suitable JPEG quality and resolution, creates a new PDF, and may make a second attempt based on the observed size. This is a limited search, not a proof of the highest quality or smallest possible file.

Image quality settings and byte counts do not form a perfectly smooth scale. Detailed pages can change size substantially between settings. The PDF compressor does not pad the result to an exact target; a smaller file is useful only if its pages remain readable.

When the attempts remain above the target, the result card says so. It keeps the smallest of the results it actually tried, including the original, rather than proving that no other setting could do better. Inspect the output before submitting.

The rebuild may reduce render resolution as well as JPEG quality. Lower resolution reduces pixel count but can make small print difficult to read, so compare it against your original at the intended viewing and printing size.

The processing runs in your browser without uploading the selected PDF to this application. Rendering many pages can be slow or memory-intensive, especially on a phone, and file and page limits apply.

Frequently asked questions

Why does compressing the same PDF on two sites give different sizes?

Because they are doing different things. One may only strip metadata; another may rasterise every page. The larger output is often the higher-fidelity one โ€” compare the text at 400% zoom rather than comparing byte counts alone.

Is a smaller PDF automatically worse quality?

No. Removing duplicated fonts and dead objects is lossless and can shrink a file substantially. Quality loss only enters when image data is re-encoded or resolution is reduced.

Can PDF compression be done without a server?

Yes. This site performs its structural rewrite and optional page rebuilding in the browser. The selected PDF is not uploaded, but a 50 MB input limit and additional page and memory limits still apply.

The file tools linked in this guide process selected files in your browser. No account or installation is required; a connection may be needed to load the page and processing code.