PDF Compression

What Is PDF Compression? A Complete Beginner's Guide

A plain explanation of what happens when a PDF is compressed: what the file is made of, why it gets big, lossless versus lossy, and why some files barely shrink.

What Is PDF Compression? A Complete Beginner's Guide

You try to attach a PDF to a form and the site refuses: "maximum 2 MB". The file is only five pages, so why is it 14 MB, when a 300-page ebook weighs less? Answering that explains almost everything about PDF compression: what it does, why it sometimes works wonders and sometimes does nothing, and why it can cost you quality.

This article is about the concept, not the buttons. If you just want the steps, go to How to compress a PDF. If you want to choose between specific methods for a specific file, see The best PDF compression methods. Here we look at what is inside the file and why it weighs what it weighs.

Quick answer

PDF compression means storing the same document in fewer bytes. A PDF is made of text and fonts, vector drawings, images, and some metadata; in most large files the images are what weigh the most. There are two kinds of compression: lossless, which repacks the data so it comes back exactly the same (like a ZIP file), and lossy, which throws away detail the eye barely notices (like JPEG photos). Lossless gains are usually small; big reductions almost always come from lossy treatment of images, which is why a scanned file can shrink a lot while a text-only file hardly changes.

What "compression" actually means for a PDF

A file is just a long list of bytes. Compression is any technique that describes the same content with fewer of them. The simplest idea: instead of writing "white pixel" ten thousand times for the empty margin of a page, you write "10,000 × white pixel". The content is identical; the description is shorter.

The PDF format was designed with this in mind. Inside a PDF, most of the heavy content lives in streams, and each stream can declare a filter that says how it was compressed. The reader (your browser, Acrobat, a phone app) sees the filter and unpacks the stream before drawing it. The most common filters are:

So a typical PDF you receive is already compressed, part by part. When people say "compress this PDF", they really mean one of two things: repack it more efficiently, or deliberately lower the quality of its heaviest parts. Keep that distinction in mind; the rest of the article builds on it.

What a PDF is made of, and which parts are heavy

If you have read What is a PDF file, you know a PDF describes each page precisely: where every letter goes, which font it uses, which lines and shapes are drawn, and where each picture sits. From a size point of view, these are the ingredients:

IngredientWhat it isTypical weightHow compressible
Page textInstructions like "draw these characters here, in this font"Very light: a few KB per pageVery well with lossless compression
FontsThe shapes of the letters, embedded so the page looks the same everywhereFrom a few KB (subset) to several MB (full font with many scripts)Moderately; the real saving is embedding only the letters used
Vector graphicsLines, charts, logos and tables drawn as shapesUsually light, unless a drawing has a huge number of points (maps, CAD plans)Well with lossless compression
ImagesPhotos, scans, screenshots, background texturesOften hundreds of KB to several MB eachBarely losslessly if already JPEG; a lot with lossy recompression
Metadata and extrasTitle, author, thumbnails, bookmarks, attachments, form fieldsUsually small, except embedded attachmentsVaries

Text and drawings are cheap; images are expensive. That is why page count tells you almost nothing about size: a 300-page novel exported from a word processor may weigh 1 or 2 MB, while five photographed pages can easily weigh ten times more.

A quick way to know what you are dealing with: open the PDF and try to select a word. If you can highlight individual words, the page has real text. If the selection draws one big box around the whole page, or nothing at all, the page is an image, and images are where size lives. The PDF Info tool also shows the page count and file size, which together give a rough sense of "KB per page": a few KB per page means text, hundreds of KB per page means images.

Why PDFs get big

Phone photos

A modern phone takes photos of 12 megapixels or more, and each one is often 3–5 MB. When you turn those photos into a PDF, many tools embed the image exactly as it is, which is good for quality but means the PDF inherits the full weight of every photo. Five pages of an ID and a contract can pass 15 MB without anything going wrong.

Scans at high DPI

DPI (dots per inch) is how many pixels the scanner records per inch of paper. An A4 page at 300 DPI is roughly 2,500 × 3,500 pixels, already more than enough for reading and printing ordinary documents. At 600 DPI, the scanner doubles the resolution in both directions, so the page has about four times as many pixels. The text does not get four times more readable, but the file gets much heavier. Scanning in full color when the document is black ink on white paper adds even more.

Fully embedded fonts

To look identical on every device, a PDF carries its fonts inside it. Good software embeds only a subset: the letters actually used. Some software embeds the entire font, including thousands of characters for scripts the document never uses. A font that supports Arabic, Latin, Cyrillic and Asian scripts can be several megabytes on its own. Use a few such fonts and a simple letter becomes a heavy file.

Repeated images

A well-made PDF stores a logo once and lets every page point to it. A poorly made one, often produced by merging many separate files or by certain export settings, stores a fresh copy of the same logo or background on every page. A 40-page report with a full-color header image repeated 40 times pays for it 40 times.

Incremental saves

This one surprises people. When you edit a PDF in some programs and click "Save", the program does not rewrite the file. It appends the changes at the end, and the old versions of the changed parts stay inside. Add an annotation, fix a typo, fill a field, save, repeat, and the file keeps growing even though the visible document hardly changed. A full rewrite of the file (what "lossless" optimization does) can usually drop those superseded copies.

Lossless vs lossy, explained simply

Think of moving house.

Lossless compression is packing well. You fold the clothes, nest the bowls inside each other, and vacuum-seal the duvets. When you unpack, everything comes out exactly as it went in. Nothing was thrown away; it was just arranged to take less room. In a PDF, this is Flate (ZIP) compression and structural cleanup: removing duplicate objects, grouping small objects into compressed "object streams", dropping old copies left by incremental saves. Text stays selectable, images stay pixel-identical.

The limit is that you cannot fold a folded shirt any smaller. Data that is already compressed, such as a JPEG photo, looks random to a ZIP-style algorithm: there are no repeated patterns left to exploit. That is why lossless optimization often saves only a few percent, and sometimes nothing at all.

Lossy compression is deciding what not to take. You leave behind the duplicate kitchen utensils and the clothes you never wear. The house works the same, but some things are gone for good. JPEG does this to images: it keeps the overall shapes and colors your eye cares about and discards fine detail and subtle color variation. At moderate settings you will not notice. At aggressive settings you start to see blur around letters, blocky patches in flat areas and halos around sharp edges.

Two practical consequences follow:

Why some PDFs barely shrink

You run a file through a compressor and get "already compact" or a saving of 2%. That is not the tool failing. It usually means one of these:

The reverse is also true: files that shrink dramatically are almost always image-heavy files that were stored generously, such as lossless PNG scans or full-resolution phone photos. Our own test, described in the step-by-step guide, showed exactly this: lossless mode left the scanned files unchanged, while strong mode cut them by around 80–99% depending on how they were originally stored.

Common myths about PDF compression

"Compression always ruins quality"

Only lossy compression removes information, and only from images. Lossless optimization changes how bytes are packed, not what they say: the document you get back is visually identical. And even lossy compression at a sensible setting on a scanned letter often produces a file that reads exactly as well on screen. Quality loss is a choice of method and level, not an automatic side effect.

"If I compress it twice, it will keep getting smaller"

Lossless compression on an already-optimized file gives you almost nothing the second time; the packing is already done. Lossy compression repeated is worse: it is like photocopying a photocopy. Each round re-encodes an image that already lost detail, adding new artifacts on top of old ones, while the size gains shrink each time. If the first result is still too big, go back to the original and choose a lower setting once, rather than compressing the compressed file.

"A bigger file means better quality"

Size tells you how much data is stored, not how good it looks. A text PDF of 150 KB stays sharp at any zoom, because the letters are drawn from font outlines. A 15 MB PDF made of slightly blurry phone photos is still blurry; it just stores the blur at great length. Likewise, a 600 DPI scan of a receipt is not more useful than a 300 DPI one for reading. The right question is "is it good enough for its purpose?", not "is it big?".

"Compression can make any file fit under any limit"

There is a floor. A 200-page scanned book will not fit into 1 MB and stay readable, whatever the tool. At that point, send fewer pages or rescan at a lower resolution.

What this means in practice

You do not need to memorize filters to compress well. Three questions from this article are enough:

  1. Is it text or images? Try selecting a word. Text files are usually small already and should be compressed losslessly, if at all.
  2. Do I need the text to stay selectable or searchable? If yes, avoid any method that turns pages into images. If the file is a scan anyway, you lose nothing.
  3. What is the file for? An upload portal with a 2 MB limit, an archive copy and a print job each justify different trade-offs.

For the actual steps, follow How to compress a PDF. For choosing between structure cleanup, image recompression, grayscale, splitting and re-exporting from the source, use the decision guide in The best PDF compression methods. Whatever you choose, keep the original file and look at the result before sending it, zooming in on small numbers and stamps.

Frequently asked questions

Is "optimizing" a PDF the same as compressing it?

The words are used loosely, but "optimize" usually means the lossless side: cleaning up the file structure, removing duplicates and unused data, and sometimes reorganizing it for faster web viewing. "Compress" often includes lossy image reduction too. Check which one a tool actually does before relying on the name.

Why did my PDF get bigger after I edited and saved it?

Many editors save changes incrementally, appending new data to the end of the file while keeping the old versions inside. Adding a signature image or new fonts also adds weight. Running the file through a lossless rewrite usually removes the leftover copies.

Does converting a PDF to grayscale reduce its size?

It can, for color scans and photos, because a grayscale image carries one channel of information instead of three. For a text document with a few colored headings it makes almost no difference. The methods guide covers when it is worth doing.

Does compressing a signed PDF keep the signature valid?

A lossless structural rewrite or a page-to-image conversion produces a new file, and a digital signature will no longer be valid because the signed bytes changed. If a document must stay signed, compress it before signing, not after.

Can I make a scanned PDF searchable and small at the same time?

Yes, but it takes two different tools: compression to reduce the images, and OCR to add an invisible text layer on top. SmokePDF does not include OCR; our OCR guide explains what to look for in software that does.

The bottom line

A PDF is heavy because of what it contains, not how many pages it has, and in most large files that means images. Lossless compression repacks the file without changing anything you see, so it is safe but usually modest. Lossy compression makes the dramatic savings by giving up image detail, and when it works by turning pages into pictures, it also gives up selectable text. Know which kind of file you have and what it is for, and the right compression choice becomes obvious.

Abdelilah Barbach

Abdelilah Barbach

Founder & Technical Content Editor

Abdelilah Barbach is the founder of SmokePDF and builds its browser-based PDF tools. He writes practical guides on compressing, converting, merging and protecting PDF files, based on how the site's own tools work and on testing them with real documents. He writes in Arabic and English.