How to compress a PDF without turning the text into pictures
Compress the images, not the pages. If the text is still selectable afterwards, the job was done correctly.
NoUpload engineering teamLast updated
Key facts
- A text-preserving compressor re-encodes only the embedded JPEG images; text, vectors, links and page geometry are copied untouched.
- Images smaller than 64×64, CMYK images, masked images and non-JPEG images are skipped on purpose rather than risk a colour shift or a broken mask.
- A re-encode is kept only when the new image is at least 5% smaller than the original.
- The rasterising mode caps at 150 pages and makes text unselectable; it is for pure scans, not documents.
A “compressed” PDF that is 80% smaller can still be a failure: open it, try to select a sentence, and you get a picture of a sentence. Once a page has been rasterised, search, copy, screen readers and text extraction all stop working. The file is smaller because the document was replaced by a photograph of itself.
There are two very different operations hiding behind the word compression.
Rasterising versus recompressing
| Approach | What changes | Text layer | Typical saving |
|---|---|---|---|
| Rasterise pages | Each page is rendered to a JPEG | Lost | 50–90% on scans |
| Recompress images | Embedded JPEGs are re-encoded | Kept | 10–80%, depends on images |
| Subset fonts / dedupe | Unused font data is dropped | Kept | Usually small, occasionally large |
Rasterising is the right tool for a scan that contains nothing but photographs of paper. It is the wrong tool for an invoice, a contract or a report, because those documents exist to be read, searched and quoted.
What a text-preserving compressor actually does
The PDF compressor walks the objects inside the file and touches only images that meet all of these conditions:
- The image is stored as JPEG (
/DCTDecode) — the browser has a decoder for it and the result is predictable. - Its colour space is RGB or greyscale. CMYK images are skipped, because a browser decoder would shift their colours.
- It has no transparency mask (
/SMaskor/Mask). Re-encoding a masked image without its mask produces the wrong shape. - It is not a 1-bit stencil (
/ImageMask). - It has no custom
/Decodearray, which changes how the bytes are interpreted. - It is at least 64 × 64 pixels. Tiny icons are not worth a generation of quality loss.
Everything else — text, vector lines, form fields, links, page geometry — is copied through untouched. That is why the text stays selectable.
Two more rules matter in practice:
- A re-encode is only kept if it is at least 5% smaller. If the new JPEG is not meaningfully smaller, the original bytes stay. Compression never makes an individual image worse for nothing.
- Skipped images are reported. The result line tells you how many images were recompressed and how many were skipped, so a file that did not shrink is explained rather than silently passed through.
The three levels
| Level | Longest side | JPEG quality | Approximate print resolution on A4 |
|---|---|---|---|
| Light | 2200 px | 85 | 220–260 dpi |
| Balanced | 1600 px | 75 | 160–190 dpi |
| Strong | 1200 px | 65 | 120–145 dpi |
“Approximate” is doing real work in that table: resolution depends on how much of the page the image covers. A full-bleed photo at 1600 px is about 190 dpi on A4; the same photo in a half-page figure is closer to 300 dpi.
Balanced is the default because 150–200 dpi is the range where a printed photo still looks like a photo at reading distance. Choose Light when the document will be printed commercially, and Strong when it will only ever be read on screen.
Why a file refuses to shrink
Some PDFs have nothing worth compressing:
- Text-only documents. A ten-page contract written in Word may contain no images at all. Recompressing cannot help; the bytes are fonts and text operators.
- Images that are already small. If every JPEG is 1500 px at quality 70, replacing it with a 1600 px quality 75 copy will not be 5% smaller, so it is skipped.
- CMYK, masked or stencil images. They are deliberately left alone, as above.
- Vector-heavy files. Charts, CAD drawings and maps are instructions rather than pixels. Downsampling does not apply.
If the result line says “0 images recompressed”, that is the honest answer: the file is already about as small as this method can make it without changing what it is.
When “Images only” is the right mode
The second mode renders every page at 200, 150 or 110 dpi and rebuilds the document from those images. It is a genuinely different operation:
- Text stops being selectable, links and form fields disappear.
- Page count is capped at 150, because each page becomes a bitmap in memory.
- It can make a file larger. A four-page test document of modest images went from 0.69 MB to 2.14 MB at the Light setting, because every page was re-encoded whether it needed it or not.
Use it for pure scans: a stack of receipts photographed on a phone, a fax, a document that was printed and scanned back. Do not use it for anything you might need to copy from.
How to check that the text survived
After compressing, open the result and:
- Drag across a paragraph. Real text highlights; a rasterised page selects as one big image.
- Press Ctrl/Cmd+F and search for a word you can see on the page. No hit means no text layer.
- If you need proof beyond the viewer, run the file through PDF to text and see whether it returns words or nothing.
Order of operations
Compression is usually the last step, not the first:
- Merge first, then compress. Recompressing ten files separately and merging them is more work and produces a larger result than merging and compressing once — shared images are handled in one pass.
- OCR before compressing a scan. OCR adds an invisible text layer, which makes the file slightly larger; compressing afterwards keeps that layer intact as long as you stay in “Keep text” mode.
- Resize before converting images to PDF. Ten 12-megapixel photos embedded in a PDF are ten 12-megapixel photos. Resizing them first is cheaper than compressing the finished document. See JPG to PDF for the page-size maths.
What this cannot fix
This method does not remove metadata, unlock encrypted files, subset fonts, or repair a corrupt document. It also cannot recover quality that was already lost: recompressing an image that has been through three chat apps will not make it sharp, only smaller.
The compression runs in a Web Worker in the tab. Nothing is uploaded, and the original file on disk is never touched — the download is a new file.
Questions this guide answers
Does compressing a PDF make the text blurry?
Not in Keep text mode. Only the embedded JPEG images are re-encoded, so text stays as vector glyphs and remains selectable and searchable. If the text is blurry, the file was put through a rasterising compressor instead.
Why did my PDF not get smaller?
The file probably has no recompressible images: text-only documents, already-small JPEGs, vector art, or images in CMYK or with transparency masks are all skipped. The result line reports how many images were recompressed, so zero is an explicit answer rather than a silent failure.
Can I compress a scanned PDF and keep it searchable?
Yes, if you OCR it first and then use Keep text mode. OCR adds an invisible text layer, and image recompression does not touch it. Rasterising the pages afterwards would throw that layer away.