How much does compressing a PDF save? We tested 30 files
By the Docmend team · Tested and published · 6 min read
Short answer
We ran 30 public-domain files through Docmend’s own compressors. Compress PDF (Recommended) cut the 19 PDFs by a median 12.9% (range 0.4–92.7%). Picture-heavy slides and JPEG scans shrank most; archive scans barely changed. Compress image at quality 72 cut JPG photos by a median 56.8%.
What we tested
30 files, all public domain or CC0, so anyone can download them and repeat the test: 9 scanned PDFs, 6 text PDFs (IRS forms, NIST and NASA publications), 4 slide-heavy PDFs, 5 JPG photos, 2 PNG photos and 4 PNG screenshots. Each file links to its source and licence in the table and the CSV.
Method
Same code as the live tools on docmend.app, the site of the Docmend Chrome extension. We loaded Docmend’s own Compress PDF and Compress image code from docmend.app (the a5 build at /tools/a5/, including the fix of 19 October 2026) and gave it each file, exactly as the Compress PDF and Compress image pages do. Nothing was uploaded; the work ran in the browser. The files tested were core/pdfTools.js (SHA-256 ce5f30a1…6a3e21) and core/imageTools.js (SHA-256 7dbf4572…f94bc); the full hashes are in the harness README.
Settings. Every PDF at all three levels (A little, Recommended, As small as possible). Every picture at the default quality 72 in the same format, and PNGs also saved as JPG.
What each PDF level does. Compress PDF re-saves large pictures (at least 160 × 160 pixels and 40 KB, 8-bit RGB or grey, stored as JPEG or Flate) as JPEG. A little: longest side at most 2,600 pixels, JPEG quality 0.82. Recommended: 1,800 pixels, quality 0.70. As small as possible: 1,200 pixels, quality 0.55. A picture is only replaced if the new one is at least 10% smaller; transparency masks are left alone. Then qpdf rewrites the file (object streams, Flate level 9, unused resources removed), and if the result is not smaller, you get the original back.
Pictures at quality 72. Compress image draws the picture on a canvas and saves it with Chrome’s own encoder: JPG at quality 0.72 (on Chrome’s 0–1 scale), PNG losslessly (PNG has no quality setting). Pixel size is not changed. If the re-saved file in the same format is not smaller, the original is kept.
Browser and computer. Google Chrome 155.0.8059.84, headless (--headless=new --no-sandbox), driven by Node 20.19.2 and puppeteer-core 23.11.1, on a cloud computer with 8 vCPUs (Intel Xeon), 15 GB of RAM and Debian 13 (Linux 6.12).
Time is measured with performance.now() around the compression call only. Loading the page, the code and qpdf, and reading the file, are not counted. Each file ran once at each setting, in a fresh browser tab. Your computer or phone may be faster or slower.
Quality. SSIM is a 0–1 similarity score where 1 means identical. We computed it in Python (NumPy 2.5, Pillow 12.3) on greyscale images with an 8 × 8 window (K1 0.01, K2 0.03), averaged over the image. For PDFs, pages were rendered with poppler’s pdftoppm 25.03: every page at 40 dpi when pictures were re-encoded, otherwise the first, middle and last page at 100 dpi. ssim_min in the CSV is the lowest page score. For pictures we compared the full image, with any transparency flattened on white.
Text and pages. Page counts come from poppler’s pdfinfo and words from pdftotext (whitespace-separated words), before and after. Every page and word was unchanged.
A fix found by this test. The first run, earlier on 19 October 2026, showed two bugs in Compress PDF: pictures stored with a separate decode setting came out scrambled, and transparency masks were saved in the wrong format, so a picture went missing. We fixed both the same day and re-ran every file; the numbers here are from the fixed tool.
Source files. Each file’s SHA-256 is in the CSV. The IRS forms are the versions downloadable on 19 October 2026: Form W-9 (Rev. March 2024) and the 2026 Form W-4. The IRS replaces these files when it revises a form, so check the SHA-256 before you compare.
Sizes are in bytes in the CSV; KB and MB on this page are 1,024-based.
Results by file type
File type
Setting
Files
Median saved
Range
Median time
Scanned PDF
Recommended
9
2.5%
0.4–69.9%
352 ms
Scanned PDF
A little
9
1.3%
0.4–49.0%
353 ms
Scanned PDF
As small as possible
9
2.5%
0.4–79.1%
300 ms
Text PDF
Recommended
6
12.55%
4.2–31.8%
462 ms
Text PDF
A little
6
12.55%
3.8–26.2%
469 ms
Text PDF
As small as possible
6
12.55%
7.4–41.6%
485 ms
Slide-heavy PDF
Recommended
4
36.2%
13.4–92.7%
1.9 s
Slide-heavy PDF
A little
4
21.25%
8.4–87.7%
1.9 s
Slide-heavy PDF
As small as possible
4
42.3%
23.9–96.6%
1.7 s
JPG photo
Quality 72, same format
5
56.8%
23.8–94.6%
222 ms
PNG photo
Quality 72, same format
2
0.0%
0.0–0.0%
271 ms
PNG photo
Quality 72, saved as JPG
2
93.25%
93.1–93.4%
109.5 ms
PNG screenshot
Quality 72, same format
4
0.0%
0.0–0.7%
104 ms
PNG screenshot
Quality 72, saved as JPG
4
71.65%
52.2–89.8%
88.5 ms
All figures are computed from the CSV, where % saved is rounded to 0.1% and time to 1 ms. A median of an even number of files is the average of the middle two, so it can end in 5 (12.55%).
Full results
PDFs at the Recommended level; pictures at quality 72 (PNGs both kept as PNG and saved as JPG). File names link to the source. All three PDF levels are in the CSV (all 74 runs).
3,840×2,160 px · PNG re-save not smaller, original kept
When compression won’t help
Archive scans that are already compressed. The library scans in this test (Internet Archive copies of NASA and Puerto Rico station reports) use JBIG2 and JPEG 2000 pictures. They’re already small, so Docmend saved 0.4–3.0%. Splitting the PDF or removing pages helps more.
Text PDFs with few pictures. The IRS forms and the two NIST guides saved 8.3–14.7% at every level, mostly from rewriting the file structure. Only the NIST framework, which has more pictures, went further (31.8% at Recommended, 41.6% at As small as possible). A text-heavy monograph saved 4.2% at Recommended.
PNG screenshots and PNG photos kept as PNG. PNG has no quality setting, so re-saving as PNG saved nothing. Saving as JPG did: a median 87.3% across these 6 files. Use JPG for photos; for screenshots with small text, check the result is still sharp.
Some JPGs shrink much less than others. Four of the five JPG photos shrank 53.6–94.6%; the Artemis II photo shrank 23.8%. How much a JPG shrinks depends on how it was saved before, and each re-save loses a little detail, so keep the original.
Download the data
Download the CSV (one row per file and setting: sizes in bytes, % saved, time, SSIM, page and word counts, source URL, licence and SHA-256 of the original). The data is released under CC0. To repeat the test, download the test scripts (zip): the browser harness, the quality checks, the sample list with SHA-256 checksums and a README with the exact versions.