PDFs
Compress a Scanned PDF on Mac (Without Killing OCR)
To compress a scanned PDF on Mac without losing the ability to search it, run OCR first and compress second. A scan is a stack of photographs with no text in it, so compression deletes pixels from the letters themselves.
Do it in that order and the result holds up better than most people expect. Our three-page test scan started at 5,017,560 bytes. After OCR and compression it was 288,609 bytes, a 94.2% reduction, with all 1,405 words still findable with ⌘F.
Do it the other way round and you get a file nobody can search and no OCR engine can rescue. Below are the measurements, including the one built-in macOS tool that silently destroys a text layer you already paid to create.
Why is a scanned PDF so much bigger than a normal one?
Because it is not a document. It is a photograph of a document, and photographs are expensive.
To make that concrete we built the same three-page agreement twice. Once as a normal PDF with embedded fonts, straight out of a browser print engine. Once as a 300 PPI color scan of those exact pages, with the blur, skew and sensor noise a flatbed adds.
| Same document, two ways | Size | What is actually stored |
|---|---|---|
| Text PDF, embedded fonts | 87,788 bytes | 3 subsetted font programs plus drawing instructions. 7,335 characters of real text. |
| Scanned, 300 PPI color | 5,017,560 bytes | Three 2,550 × 3,300 JPEGs. Zero characters of text. |
Fifty-seven times larger, for the same words. Every letter that was a reference to a glyph in a font is now several hundred colored pixels, and your scanner saved the paper texture at the same fidelity as the type.
That is why a scanned contract blows past an upload limit that a word-processor export would clear with room to spare, and why the only lever that moves the number is resolution. There is no font to subset, no duplicate object to merge, no structure to repack. You are compressing photographs. The full comparison of every Mac compression route covers the other document types.
How small can you make a scan before the text stops working?
Further than instinct suggests, and then it falls off a cliff. We ran the scan through all five Smol presets, which are long-edge pixel caps rather than DPI targets, then fed every output back to Tesseract and scored the extracted words against the original 1,405.
| Preset | Image size | Effective PPI | File size | Re-OCR accuracy |
|---|---|---|---|---|
| Source scan | 2,550 × 3,300 | 300 | 5,017,560 B | 100.00% |
| Original | 1,855 × 2,400 | 218 | 1,725,428 B | 99.93% |
| Large | 1,391 × 1,800 | 164 | 608,034 B | 100.00% |
| Medium | 927 × 1,200 | 109 | 266,924 B | 100.00% |
| Small | 695 × 899 | 82 | 149,269 B | 96.80% |
| Tiny | 464 × 600 | 55 | 47,373 B | 1.42% |
Read the last two rows again. At 82 PPI an OCR engine still recovers 96.8% of the words. At 55 PPI it recovers 1.42%, which is noise. The page did not get gradually worse. It crossed a line where the stroke width of 10.5 pt type falls under about one pixel, and below that line the letterforms stop existing.
The 99.93% on Original against 100% on the two presets below it is a single word out of 1,405. That is recognition noise, not a trend, and we are reporting it rather than rounding it away.
Our sibling article on reducing PDF file size without wrecking the text measured the same collapse on a different document and puts the DPI decision in context. The practical rule out of both runs is the same: stay at or above 150 PPI for anything with body copy, and treat 100 PPI as the floor for anything you might need to read again.
How do you keep the scanned PDF searchable?
Add the text layer before you compress, not after. This is the whole trick, and it inverts what most people do.
An OCR pass writes a second, invisible copy of the page into the PDF: the same words, positioned over the picture of the words, drawn in a font with no visible glyphs. That layer is what ⌘F searches and what Spotlight indexes. It is text, not pixels, so image compression cannot touch it.
We proved that by OCRing the scan first and then running all five presets over the result:
| Preset applied after OCR | File size | Effective PPI | Searchable words |
|---|---|---|---|
| Source (OCR, uncompressed) | 5,032,225 B | 300 | 1,405 |
| Original | 1,736,280 B | 218 | 1,405 |
| Large | 624,925 B | 164 | 1,405 |
| Medium | 284,590 B | 109 | 1,405 |
| Small | 166,998 B | 82 | 1,405 |
| Tiny | 65,126 B | 55 | 1,405 |
Every preset, all 1,405 words. Even tiny, where the picture of the page is illegible to a human and worth 1.42% to an OCR engine, is still perfectly searchable, because the search is not reading the picture.
The text layer costs almost nothing. At the tiny preset the searchable file is 65,126 bytes against 47,373 without the layer: 17,753 bytes for three pages, under 6 KB a page. There is no size argument for skipping OCR.
What is the actual command to OCR a scan on a Mac?
OCRmyPDF is the tool. It wraps Tesseract, keeps the original page images, and writes the invisible layer underneath. Install it once:
brew install ocrmypdfThen run it. Both of these were run on the 5,017,560-byte test scan:
# add a text layer, leave the images alone
ocrmypdf scan.pdf searchable.pdf
# add a text layer and re-encode the images on the way through
ocrmypdf --optimize 3 --jpeg-quality 70 scan.pdf searchable.pdf| Step | Size | PPI | Searchable words | Time |
|---|---|---|---|---|
| Source scan | 5,017,560 B | 300 | 0 | — |
| ocrmypdf (default) | 2,754,671 B | 300 | 1,405 | 9.77 s |
| ocrmypdf --optimize 3 | 1,372,066 B | 300 | 1,405 | 8.48 s |
| …then Smol medium | 288,609 B | 109 | 1,405 | — |
Note the second row. OCRmyPDF on its defaults made the file 45.1% smaller while adding a text layer, because it re-encodes the scanner’s wasteful JPEGs on the way through and keeps all 300 PPI. If you need the scan at full resolution for a print or a filing, that single command is the entire job.
If you would rather not touch a terminal, the same order of operations applies to any GUI route: OCR in whatever tool you have, then compress the OCR’d file. The compressor does not care which tool wrote the layer.
Which tools destroy an OCR text layer?
One of the four we tested, and it is the one macOS hands you for free.
Preview’s Reduce File Size applies a Quartz filter, and a Quartz filter does not compress a PDF so much as rebuild it through Quartz’s own PDF writer. On the way through, the invisible OCR font is re-subset and renamed, and the character map that made it readable does not come out the other side.
| Method | Size | PPI | Searchable words | “Confidential” found |
|---|---|---|---|---|
| OCR’d source | 5,032,225 B | 300 | 1,405 | 8 |
| Ghostscript /ebook | 675,808 B | 150 | 1,405 | 8 |
| Ghostscript /screen | 275,529 B | 72 | 1,405 | 8 |
| Smol, any preset | 65,126–1,736,280 B | 55–218 | 1,405 | 8 |
| Preview, Reduce File Size | 1,824,000 B | 144 | 188 | 0 |
Zero. A document that contained the word Confidential eight times contains it zero times after the pass, according to poppler, MuPDF, and Apple’s own PDFKit. What is left is not damaged text, it is not text: across the 188 tokens pdftotext still reports, a search for any run of two or more letters returns nothing at all.
The mechanism is visible in one command. Before the filter, the fonts list shows Tesseract’s layer. After it, the same object is a renamed subset with no usable mapping:
pdffonts searchable.pdf
# GlyphLessFont CID TrueType Identity-H yes no yes
pdffonts after-preview.pdf
# AAAAAB+font0000000030685d5b CID TrueType Identity-H yes yes yesNothing on screen changes, which is what makes it dangerous. The pages look right, the file is smaller, and the searchability you paid for in OCR time is gone. We took Preview’s filter apart in detail in why Preview’s Reduce File Size ruins PDFs; this is one more entry on the list.
The practical check takes five seconds: open the compressed file, press ⌘F, and search a word you can see on the page. If it finds nothing, the layer is gone and you need to OCR again from the original.
Should you convert the scan to grayscale?
For a black-ink document on white paper, yes, and it is the most under-used lever in this whole category. Grayscale throws away two of the three color channels and keeps every pixel of resolution.
| Route | Size | PPI kept | Change |
|---|---|---|---|
| Source, 300 PPI color | 5,017,560 B | 300 | — |
| Grayscale, 300 PPI | 1,720,854 B | 300 | −65.7% |
| Color, downsampled to 150 PPI | 568,286 B | 150 | −88.7% |
| Grayscale, 150 PPI | 536,034 B | 150 | −89.3% |
Two-thirds off with the resolution untouched. For a scanned passport page, a court exhibit, or anything where a reviewer needs to read small print, that is a far better trade than dropping to 150 PPI in color. The command:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 \
-sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=gray.pdf scan.pdfOnce you are at 150 PPI the color channels barely matter any more, which is why the last two rows are within 6% of each other. Grayscale is a full-resolution move, not a stack-it-on-top move. The rest of the terminal toolkit is in compressing PDFs from the Terminal on macOS.
What order should you actually do this in?
- Check whether a text layer already exists. Open the file, press ⌘F, search a visible word. If it hits, skip to step 3.
- OCR the original at full resolution.
ocrmypdf scan.pdf searchable.pdf. Never OCR a file you already compressed. Ours scored 1.42% at 55 PPI. - Convert to grayscale if the ink is black. Two-thirds off with no resolution loss.
- Compress to the resolution the destination needs, not the smallest one available. 150 PPI and above for body copy.
- Search the output before you send it. One ⌘F catches a destroyed text layer in five seconds.
If the scans arrive by the folder rather than one at a time, the OCR step is the slow part and it parallelizes badly, so run it as a loop overnight and keep compression as a separate, fast pass. Batch compressing PDFs on Mac covers that side. If the problem is an upload form rejecting the result, our guide to PDFs that are too big to upload has the target-size table.
When Smol is not the answer for a scanned PDF
Three cases from this test where something else is the better tool, and we would rather say so up front.
Your scan has no text layer and you need one. We compress PDFs. We do not run OCR, and no compression setting will ever add a searchable layer. OCRmyPDF is free, it is one brew install, and on its defaults it made our test file 45% smaller as a side effect. Run it first. We are the second step, not the first.
You need to keep exactly 300 PPI. Our presets are pixel caps, so on a US Letter page the ceiling is 2,400 px on the long edge, which is 218 PPI. If a filing rule or an archive standard specifies 300, use Ghostscript with an explicit resolution target, or grayscale conversion on its own, and leave the pixel count alone. Same story for anything heading to a press, which we go through in compressing a PDF for print.
It is one file, once, and nobody will search it. A single scanned receipt going into an expense form does not need a $29 app. Preview’s Reduce File Size will get it under the limit, and the text layer it destroys is one you were never going to use.
Where we do earn it: a folder of scans, a text layer that has to survive, and wanting a resolution ladder rather than one button. Smol is $29 once, it runs entirely on your machine, and nothing about a scanned contract should be uploaded to a stranger’s server anyway. If you want the wider field, we compared the Mac PDF compressors including where each one wins.
How these numbers were measured
Everything here was run on 26 September 2026 on a MacBook Pro (Mac14,9) with an Apple M2 Pro, 10 cores and 16 GB of RAM, on macOS 27.0 (build 26A428). Sizes are raw bytes from stat. Image dimensions and effective resolution come from pdfimages -list.
Fixture provenance. The test document is a 1,405-word services agreement we wrote ourselves for this article. It was rendered to PDF with headless Chrome (Skia/PDF m153), rasterized to three 2,550 × 3,300 pages with pdftoppm -r 300, then given the artifacts a flatbed adds with ImageMagick 7.1.2: a fraction of a degree of skew, a 0.6 px blur, Gaussian sensor noise and a slight paper tint. The pages were reassembled into a Letter-size PDF at 300 PPI. No customer document, no personal file and no third-party copyrighted material was used.
OCR scoring. Each output was rendered back to grayscale PNGs at 300 DPI with pdftoppm and read by Tesseract 5.5.2 in --psm 6. Accuracy is the proportion of the 1,405 ground-truth words recovered by sequence alignment, so both substitutions and dropped words count against it.
Tool versions. Ghostscript 10.07.0, qpdf 12.3.2, poppler 26.04.0, OCRmyPDF 17.4.2, MuPDF 1.27.1, Smol 1.0.35. Preview’s filter was applied by handing /System/Library/Filters/Reduce File Size.qfilter to PDFKit’s write(to:withOptions:) with the QuartzFilter option, which is the same code path the app’s export sheet uses.
Frequently asked questions
Does compressing a scanned PDF remove the OCR text layer?
It depends entirely on the tool. Ghostscript and Smol preserved all 1,405 searchable words at every setting we tested, down to 55 PPI. Preview’s Reduce File Size did not: a document containing the word "Confidential" eight times contained it zero times afterwards, confirmed with poppler, MuPDF and Apple’s own PDFKit. Always search the output before you send it.
Should I OCR before or after compressing a scanned PDF?
Before, always. The text layer is text, not pixels, so image compression cannot damage it, and it costs under 6 KB per page. Compressing first destroys the source an OCR engine needs: our scan scored 100% recognition at 164 PPI and 1.42% at 55 PPI. Once you have compressed too far, no amount of OCR will recover the words.
What DPI should a scanned PDF be compressed to?
150 PPI or above for anything with body copy. In our measurements an OCR engine recovered 100% of words at 164 and 109 PPI, 96.8% at 82 PPI, and 1.42% at 55 PPI. The collapse happens when the stroke width of 10 or 11 pt type falls below roughly one pixel. Scan at 300 PPI, compress to 150, and you have margin in both directions.
How do I make a scanned PDF searchable on a Mac?
Install OCRmyPDF with "brew install ocrmypdf", then run "ocrmypdf scan.pdf searchable.pdf". On our three-page test scan it added a full 1,405-word searchable layer in 9.77 seconds and, because it re-encodes the scanner’s JPEGs on the way through, made the file 45.1% smaller at the same 300 PPI.
Why is my scanned PDF 50 MB when the same document as text is 100 KB?
Because a scan stores photographs of the pages instead of characters and fonts. Our test agreement was 87,788 bytes as a text PDF and 5,017,560 bytes as a 300 PPI color scan of the same three pages, 57 times larger, with zero extractable text. Resolution is the only lever that moves that number.
Does converting a scan to grayscale make it much smaller?
Yes, and it costs no resolution. Converting our 300 PPI color scan to grayscale took it from 5,017,560 to 1,720,854 bytes, a 65.7% reduction, with every page still at a full 300 PPI. For black ink on white paper that is a better trade than halving the resolution, and it is one Ghostscript command.
Keep reading