Methodology
File Maktab's compression engine walks every page of a PDF, finds the embedded JPEG images, and re-encodes them at the quality and maximum dimension of the chosen preset. Text, vector graphics, and document structure are not touched; the file is then re-saved with compressed object streams. Because the engine's only lever is the embedded images, the benchmark is designed around document types whose image content differs.
Each of the twelve samples was generated deterministically (seeded random content, fixed PDF metadata timestamps), then compressed once per preset. Every measurement ran twice; both runs produced byte-identical results, so each published number is a single exact measurement rather than an average. The benchmark clock is pinned during compression because the PDF writer stamps a modification date into the file metadata — a difference of a few bytes that has nothing to do with compression.
Size reduction is defined exactly as: reduction % = (original size − compressed size) ÷ original size × 100. Sizes below are shown in KB or MB for readability; the underlying measurements are exact bytes.
The three presets are the ones the production tool exposes:
| Preset | JPEG quality | Max image dimension |
|---|---|---|
| Strong compression | 0.42 | 900 px |
| Recommended | 0.55 | 1400 px |
| High quality | 0.78 | 2200 px |
Dataset
Twelve synthetic documents in six categories, two per category. Every file was purpose-built for this benchmark — no user files, no customer data, no third-party documents. Photo-like images are gradient-and-grain JPEG fields; scanned pages are synthetic images with text-line strips and scanner-like noise; text and table documents contain only text and vector lines.
| Sample | Category | Pages | Embedded JPEGs | Original size |
|---|---|---|---|---|
| Text report (24 pages) | Text-heavy document | 24 | 0 | 42 KB |
| Text report (60 pages) | Text-heavy document | 60 | 0 | 104 KB |
| Photo document (6 images) | Image-heavy document | 6 | 6 | 8.88 MB |
| Photo document (12 images) | Image-heavy document | 12 | 12 | 17.76 MB |
| Scanned document (10 pages) | Scanned document | 10 | 10 | 3.75 MB |
| Scanned document (20 pages) | Scanned document | 20 | 20 | 7.51 MB |
| Mixed report (12 pages) | Mixed text + images | 12 | 6 | 5.52 MB |
| Mixed report, larger images (12 pages) | Mixed text + images | 12 | 6 | 11.46 MB |
| Presentation (16 slides) | Presentation / slides | 16 | 4 | 2.93 MB |
| Presentation (30 slides) | Presentation / slides | 30 | 8 | 5.85 MB |
| Spreadsheet export (20 pages) | Spreadsheet / table-heavy | 20 | 0 | 41 KB |
| Spreadsheet export (40 pages) | Spreadsheet / table-heavy | 40 | 0 | 81 KB |
Results
Compressed size and size reduction for every sample at every preset. Images re-encoded equals the number of embedded JPEGs the engine rewrote; for text and table documents the engine correctly found nothing to compress.
| Sample | Original | Strong | Recommended | High quality |
|---|---|---|---|---|
| Text report (24 pages) | 42 KB | 42 KB (−0%) | 42 KB (−0%) | 42 KB (−0%) |
| Text report (60 pages) | 104 KB | 104 KB (−0%) | 104 KB (−0%) | 104 KB (−0%) |
| Photo document (6 images) | 8.88 MB | 262 KB (−97.1%) | 801 KB (−91.2%) | 5.19 MB (−41.6%) |
| Photo document (12 images) | 17.76 MB | 521 KB (−97.1%) | 1.56 MB (−91.2%) | 10.37 MB (−41.6%) |
| Scanned document (10 pages) | 3.75 MB | 437 KB (−88.6%) | 934 KB (−75.7%) | 3.40 MB (−9.4%) |
| Scanned document (20 pages) | 7.51 MB | 876 KB (−88.6%) | 1.83 MB (−75.7%) | 6.81 MB (−9.4%) |
| Mixed report (12 pages) | 5.52 MB | 207 KB (−96.3%) | 840 KB (−85.1%) | 3.19 MB (−42.2%) |
| Mixed report, larger images (12 pages) | 11.46 MB | 276 KB (−97.6%) | 802 KB (−93.2%) | 4.03 MB (−64.8%) |
| Presentation (16 slides) | 2.93 MB | 185 KB (−93.8%) | 581 KB (−80.7%) | 1.70 MB (−42%) |
| Presentation (30 slides) | 5.85 MB | 365 KB (−93.9%) | 1.12 MB (−80.8%) | 3.38 MB (−42.3%) |
| Spreadsheet export (20 pages) | 41 KB | 41 KB (−0%) | 41 KB (−0%) | 41 KB (−0%) |
| Spreadsheet export (40 pages) | 81 KB | 81 KB (−0%) | 81 KB (−0%) | 81 KB (−0%) |
| Category | Samples | Average reduction (recommended preset) | Observed range across presets |
|---|---|---|---|
| Text-heavy document | 2 | 0% | 0% to 0% |
| Image-heavy document | 2 | 91.2% | 41.6% to 97.1% |
| Scanned document | 2 | 75.7% | 9.4% to 88.6% |
| Mixed text + images | 2 | 89.2% | 42.2% to 97.6% |
| Presentation / slides | 2 | 80.8% | 42% to 93.9% |
| Spreadsheet / table-heavy | 2 | 0% | 0% to 0% |
What the results mean
Within this benchmark dataset:
- Image content decides almost everything. The two text-only categories — dense reports and spreadsheet tables — measured 0% reduction at every preset, because the engine found zero embedded images to re-encode.
- Image-heavy documents compress the most: an average of 91.2% at the recommended preset and 97.1% at strong compression. Most of that gain comes from downscaling large embedded photos to the preset's maximum dimension, not from quality loss alone.
- Scanned documents behave like image documents, because a scan is an image. They averaged 75.7% at the recommended preset — but notice the high-quality preset only reached 9.4%: our synthetic scans (1240 px wide) already sit under that preset's 2200 px dimension cap, so only the lighter re-encode applied.
- Mixed documents land in between, tracking how much of the file is images: 85.1% to 93.2% at the recommended preset depending on image size.
- The preset choice is a genuine trade-off, not a formality: on the 12-image photo document the measured spread between strong and high quality is 533 KB versus 10.87 MB from the same 18.62 MB original.
Compression for email
The most common reason to compress a PDF is an email attachment limit. Gmail and Outlook.com both publish a 25 MB per-message attachment limit, and many corporate gateways are stricter — check the limit of the service you actually send through.
Read against the measured table: our 18.62 MB photo document fits under 25 MB before compression, but at the recommended preset it becomes 1.63 MB — trivially attachable, with room to spare for the rest of the message. The 3.93 MB scanned document becomes 0.96 MB. The text reports were never a problem at all: at 43 KB and 107 KB they were already far below any limit, which is exactly why compression returned 0%.
The benchmark also shows when compression is the wrong tool: a document that is already small gains nothing, and a document that stays too large after compression needs a different answer — splitting it, or sending a download link instead of an attachment. For the full workflow, read how to compress a PDF for email.
Limitations
- The dataset is synthetic. Photo-like images are gradient-and-grain fields, not real photographs; real camera photos contain different detail patterns and will measure somewhat differently.
- Twelve samples in six categories illustrate how document structure drives compression; they are not a statistical model of all PDFs.
- Real-world text PDFs usually embed fonts and are larger than our font-free text samples, but they still contain no compressible images, so the 0% finding generalizes even if the byte counts do not.
- Measurements come from one engine — File Maktab's browser compression engine in Chrome/151.0.7922.173. JPEG encoding is implemented by the browser, so other browsers and versions may produce slightly different bytes. No competitor tools were measured.
- Visual quality was not scored. What the engine does to images is stated exactly — JPEG quality 0.42/0.55/0.78 and maximum dimensions of 900/1400/2200 px — so the quality trade-off is defined by those parameters rather than by a subjective rating.
- PDF metadata timestamps were pinned during measurement for reproducibility; metadata accounts for a few bytes either way.
Reproduce this benchmark
Everything on this page is reproducible. The dataset generator and measurement harness live in the File Maktab repository at benchmark/browser-entry.ts and benchmark/run.mjs. Running node benchmark/run.mjs regenerates the twelve samples deterministically, runs the production compression engine (client/src/lib/pdfCompressionEngine.ts) against every sample and preset twice inside headless Chromium, verifies the two runs are byte-identical, and writes the measured dataset to shared/pdfCompressionBenchmark.ts — the same data file this page renders. No user files are involved at any step.