Skip to content
LooparaLoopara
How-To Guides10 min read1,224 words

How to compress a PDF without ruining it

PDF size is almost always images, and almost every compression tool solves it by making them worse. Knowing which knob is being turned lets you choose the trade rather than accept it.

Loopara
Pdf link icon
Pdf link icon

Short answer

A large PDF is usually large because of embedded images. Compression tools reduce their resolution and re-encode them, which is why text from a scan becomes blurry. Downsample to 150 DPI for screen reading and 300 DPI for printing, and if the file is a text document rather than a scan, export it again from the source instead of compressing it.

On this page
  1. Where the size actually is
  2. The two operations
  3. The mistake worth avoiding
  4. Getting it right for scans
  5. Keeping the text searchable
  6. Doing it locally
  7. When the file is still too large
  8. What happens when you compress a PDF?
  9. Which DPI for which purpose?
  10. Why did compression make it worse?
  11. Doing it offline
  12. Keeping the text searchable
  13. When no setting will help

Every PDF compressor has one slider and does not tell you what it controls. Understanding that one thing turns compression from a gamble into a decision.

Where the size actually is

Open a large PDF and ask what is in it:

  • Scans and photographs. Almost always the answer. A phone-camera page at full resolution is several megabytes, and ten of them make a file nobody can email.
  • Embedded fonts. Fractions of a megabyte, and worth keeping — a PDF without its fonts renders differently on other machines.
  • Actual text and vector graphics. Negligible. A hundred-page text document with no images is often under a megabyte.

This is why the same tool can take one file from 40 MB to 4 MB and barely touch another. It is not compressing the PDF; it is compressing the pictures inside it.

The two operations

Downsampling reduces resolution — a 3000-pixel-wide page image becomes 1275 pixels. This is where nearly all the saving comes from, and it is measured in DPI, dots per inch across the printed page.

  • 72–96 DPI — screen reading only. Text becomes soft. Fine for a receipt, poor for anything you will read at length.
  • 150 DPI — the sensible default for documents that will be read on screen. Text stays sharp at normal zoom.
  • 300 DPI — printing, and any document with small print or fine detail.
  • 600 DPI — archival scanning and line art. Rarely necessary otherwise.

Re-encoding changes the image format and quality — usually to JPEG at some quality level. JPEG is lossy, and repeated passes accumulate damage: compressing an already-compressed PDF a second time is visibly worse than doing it once from the original.

The mistake worth avoiding

Compressing a text document. If the PDF was exported from a word processor, a design tool or a browser, its text is real text, not pictures of text. There is almost nothing for a compressor to remove, so a tool asked to shrink it anyway will often rasterise the pages — convert text into images — producing a file that is blurry, unsearchable, and sometimes larger than it started.

If the file came from a source document, go back and export it again. Most applications offer a smaller-file or web-optimised export that reduces image quality without touching the text layer.

Getting it right for scans

  1. Scan at 300 DPI in the first place. You cannot recover detail that was never captured, and scanning at 600 DPI to compress later just makes both steps worse.
  2. Use greyscale for text documents, not colour. Roughly a third of the size, with no readability loss on a black-ink page.
  3. Use black and white (1-bit) for clean printed text. Dramatic savings, and it destroys photographs, so only for documents that are genuinely just type.
  4. Downsample once, to the DPI you need, rather than repeatedly nudging a slider.

Keeping the text searchable

A scan is a picture until OCR runs over it. Compression tools frequently discard the OCR text layer, which is invisible in the viewer and catastrophic for finding anything later.

After compressing a scanned document, try selecting a word. If you cannot, the text layer is gone — re-run OCR on the compressed file, or use a tool that preserves it. Most desktop PDF applications and several command-line tools do OCR locally, which is also the right choice for anything confidential.

Doing it locally

The same privacy question applies as to any online file tool: a bank statement or a contract uploaded to a free compressor is a document on someone else's server.

  • macOS Preview exports with a Quartz filter that reduces file size, though with little control.
  • Ghostscript does this precisely and offline. Its presets — /screen, /ebook, /printer, /prepress — correspond roughly to 72, 150, 300 and 300+ DPI.
  • Several browser-based tools run PDF libraries in WebAssembly and never upload the file. Verify by disconnecting the network before processing.
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4    -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH    -sOutputFile=out.pdf in.pdf

When the file is still too large

If the document is genuinely a hundred pages of photographs, no setting will make it small. The realistic options are to split it into parts, share a link rather than an attachment, or accept that this file is large because its contents are.

Compression is a trade between size and detail. The only bad version is the one where you did not know which you were giving up.

What happens when you compress a PDF?

To compress a PDF is to reduce the size of the images inside it, because in almost every large PDF the images are the size. Two operations do the work: downsampling, which lowers their resolution, and re-encoding, which changes their format and quality.

Text and vector graphics contribute almost nothing. A hundred-page text document is often under a megabyte, which is why compressing one achieves nothing and sometimes makes it worse.

Which DPI for which purpose?

DPIUseTrade-off
72–96Screen only, receiptsText becomes soft
150Documents read on screenThe sensible default
300Printing, small printRoughly 4× the data of 150
600Archival scanning, line artRarely necessary

Choose the row that matches where the file is going, then downsample once. Repeatedly nudging a slider applies lossy compression several times to damage that already exists.

Why did compression make it worse?

Because the PDF contained real text and the tool rasterised the pages — turning text into pictures of text. The result is blurry, unsearchable, and sometimes larger than the original.

If the file came from a word processor or a design tool, go back and export it again with a smaller-file or web-optimised setting. That preserves the text layer, which compression cannot restore once it is gone.

Doing it offline

Ghostscript compresses precisely and locally, with presets that correspond roughly to the DPI table above. Preview on macOS offers a simpler filter, and several browser tools run PDF libraries in WebAssembly without uploading — verify by disconnecting the network first. See file tools, guides and online tools.

Keeping the text searchable

A scan is a picture until OCR runs over it, and compression tools frequently discard the OCR text layer. That is invisible in the viewer and catastrophic later, because a document you cannot search is a document you cannot find.

After you compress a PDF, try selecting a word. If you cannot, re-run OCR on the compressed file — most desktop PDF applications and several command-line tools do it locally, which is also the right choice for anything confidential.

When no setting will help

If the document is genuinely 100 pages of photographs, it is large because its contents are. Split it into parts, share a link instead of an attachment, or accept the size. The Ghostscript documentation sets out exactly which knobs exist, and none of them makes 100 photographs small without making them worse. Compress a PDF once, at the DPI the destination needs, and keep the original. That is the whole procedure, and it survives every tool you might use to carry it out.

Frequently asked questions

Why did my PDF get blurry after compression?
The tool downsampled the images inside it, and if the pages were scans that includes the text. Compressing again from the original at a higher DPI is the fix; there is no way to recover detail from the compressed copy.
What DPI should I use?
150 DPI for documents read on screen, 300 DPI for anything printed or containing small print. Below about 120 DPI text starts to soften noticeably.
Why did compressing make my file bigger?
Usually because the PDF contained real text and the tool rasterised the pages into images. A text-based PDF should be re-exported from its source document rather than compressed.
Does compression remove searchable text?
It can. Many tools discard the OCR layer on scanned documents. Try selecting a word afterwards, and re-run OCR if you cannot.

Sources

  1. PDF 2.0 (ISO 32000-2)ISO
  2. Ghostscript documentationArtifex
  3. pdf.jsMozilla

Published by

Loopara

Practical guides, free tools, workflows, and resources for productivity, files, images, video, text, creators, and everyday digital tasks.

About the publication

Related reading

Keep going