How PDF Compression Works Under the Hood
PDF compression is a set of choices about images, fonts, and structure. Here is what actually changes when you hit compress.
By Rehan Baqir
Related
Compress PDF mostly rewrites embedded images and leftover objects. It does not invent a smaller copy of text that is already compact, and it cannot undo a page that was flattened into a picture. A 120-page annual report exported from Word may shrink by only 4% in the same tool that takes a 12-page scan of signed contracts from 48 MB to 6 MB. The gap follows from what is inside the file.
A PDF is a container, not a single image
From the outside, a PDF is one file. Inside, it is a bundle:
- Pages that reference content streams
- Fonts, embedded or referenced
- Images: photos, logos, scanned page bitmaps
- Vector graphics: lines, shapes, text outlines
- Metadata: title, author, creation date
- Optional extras: bookmarks, forms, attachments
Compression targets the heavy parts, which are almost always images, and it tidies structural waste. It rarely rewrites body text character by character.
Where the bytes actually live
| Source type | Typical weight | Compression impact | |-------------|----------------|-------------------| | Phone scan saved as PDF | Very high | Large. The entire page is an image | | Word / Google Docs export | Low to medium | Small unless many high-res images | | PowerPoint export | Medium to high | Moderate. Slides often rasterize effects | | CAD / design export | Variable | Depends on embedded previews | | Mixed merge (scan + digital) | High | Images dominate savings |
When compression is a bad idea is the decision. This page is about what changes when you compress. If you are combining files, Merge PDF comes first so you compress the result once. Split PDF and PDF to JPG are the other exits when a smaller PDF is the wrong output.
Image compression inside PDFs
Most of the size reduction comes from re-encoding embedded images:
- Downsampling lowers resolution, for example 300 dpi to 150 dpi for screen reading.
- Lossy JPEG recompression merges similar color blocks and reduces fine detail.
- Color space changes, such as RGB to grayscale, suit monochrome scans.
- Stripping invisible layers removes OCR layers or duplicate preview images some scanners add.
Text stored as real text objects stays sharp because it is vector instructions: draw glyph A at position x, y. Compression does not pixelate that the way it pixelates a photograph of a page.
When the whole page is an image
Flatbed scans and phone "document" modes often produce a PDF where each page is one big bitmap. Compression then behaves like photo compression, because that is what it is, wrapped in a PDF. Contract scans shrink a lot. Spreadsheets barely move. A 12-page scan can drop by about 80%, while a 100-page text report barely changes.
Object and stream optimization
Beyond images, an optimizer may:
- Remove duplicate font subsets when the same font was embedded again after a merge
- Drop unused objects left from editing
- Compress content streams with Flate (zlib-style) encoding, which is lossless packing of PDF instructions
- Remove thumbnails or alternate images you never see
Those fixes add up on messy files, especially after merging several PDFs. They will not halve a clean two-page letter.
What compression usually leaves alone
Searchable text layers stay, unless the whole page is an image. Hyperlinks and bookmarks stay in most consumer tools. Vector line art at ordinary complexity stays. Form field structure usually stays, though some aggressive optimizers flatten forms. Test that if you rely on fillable fields.
Compress with the output open
- Identify the source: scan-heavy, or a digital export.
- Merge first if you are combining files (Merge PDF), then compress once.
- Open Compress PDF and start at medium for mixed documents.
- Download and check the smallest text on page 1, a photo or scan page if there is one, and the file size against the original.
- If email still rejects it, see email attachment limits before you turn the setting to maximum.
Worked example: board pack
Input: a 35 MB merged PDF, 10 slides exported from PowerPoint plus 40 pages of scanned approvals.
What compression likely did:
- Recompressed the images embedded in the slides, moderately
- Downsampled the 40 scan pages aggressively, which is where most of the bytes lived
- Removed duplicate font entries from the slide exports
Result: about 9 MB, readable on a laptop, acceptable for email. Signatures still legible at 100% zoom, and not print-archive quality.
The archive copy is the original 35 MB, kept offline.
Common misconceptions
Compression does not improve quality. On image-heavy content it trades detail for size.
PDF compression is not encryption. A smaller file is not a protected file. See PDF password protection for access control, and for the limits of that control.
Print-to-PDF and then compress does not fix a bad export. Print-to-PDF often rasterizes content into images, which makes files bigger and harder to search. Compression cannot fully undo that.
ZIP is a different operation. ZIP wraps the whole file. PDF compression rewrites objects inside the PDF, especially images and duplicate resources. Compression also does not remove viruses. Scan a suspicious file with antivirus regardless of size.
Privacy and browser-based compression
When compression runs in the browser (how browser PDF tools protect privacy), the algorithm still reads image streams locally. "Upload-free" means the bytes may never leave the device. Sensitive documents still need a tool you trust, and you should keep the original.
When compression is not enough
- Split PDF and send chapters separately
- Re-scan at a lower dpi, such as 300 down to 200 for internal reference
- Replace scan pages with digital signatures where that is legally acceptable
- Share a link instead of an attachment
Limitations
Lossy image compression is one-way. Once high-resolution scans are downsampled to 150 dpi, you cannot recover print sharpness from the compressed copy.
Vector-heavy CAD or illustration PDFs with hundreds of thousands of path nodes may stay large, because image downsampling does not simplify vector geometry.
Some rasterizing compressors flatten interactive form fields. Test a fillable form after you compress it.
Related reading
- When Should You Compress a PDF?
- How to Compress PDF Files Without Losing Quality
- Combining Scanned and Digital PDFs
You can predict the result once you know the file is a bundle of objects. Image-heavy scans shrink. Clean text barely moves. Keep an untouched original when you still need print sharpness, instead of chasing megabytes on the only copy.
Frequently Asked Questions
Common questions answered to help you get the most from this tool.