Why PDFs get huge and how to shrink them: images, fonts, scans and compression

A 40-page contract that arrives as a 60 MB PDF is carrying about 1.5 MB per page, and text cannot explain that: the whole text of a long novel fits in under 1 MB. The weight is in images — usually a colour scan at 300 dpi at the scanner’s default JPEG quality — and occasionally in fonts, attachments or a stack of old revisions. This guide shows you how to find out which with a few commands, then how to shrink each kind: rewriting a Word or LaTeX export so it stays searchable, re-encoding a scan so it stays legible and OCR-able, and what the compressor on this site does and does not do, so you can meet a 2 MB portal limit or a 200 KB form upload without turning text into mush.

What actually takes the space

A PDF is a bag of numbered objects. The page content streams that place each glyph are tiny: text is stored as glyph codes plus positions, two to three bytes per character before Flate compression, so the words of a 40-page contract weigh well under half a megabyte. Everything large is a resource the pages point at. The table is the anatomy, in the order you should suspect things.

ComponentWhere it hidesTypical weightFix
Images/Subtype /Image XObjects; a scanned page is one full-page image100 KB to 25 MB per page, depending on resolution, colour depth and codecDownsample, drop colour, choose the right codec
Fonts/FontFile2 (TrueType), /FontFile3 (CFF), /FontFile (Type 1)Subset 10–60 KB; full Latin font 100–400 KB; full CJK font well over 10 MBSubset — never strip
Duplicated resourcesThe same logo or font embedded once per page by print drivers and naive mergesA small cost times the page countFull rewrite with qpdf or Ghostscript
Attachments/EmbeddedFiles name tree, file-attachment annotationsWhatever was attached — often the original .docxqpdf --list-attachments, then remove
Incremental updatesEverything appended after the first %%EOFby Acrobat’s Save, form filling and signingEvery save appends; old versions staySave As, or a full rewrite (not on signed files)
Metadata and thumbnailsXMP packet, per-page /Thumb imagesTens of KB; a few MB if thumbnails were embeddedUsually not worth chasing

The arithmetic behind the first row is what makes images dominate. An A4 page is 210 × 297 mm; at 300 dpi that is 2480 × 3508 pixels, 8.7 million of them. In 24-bit colour the raw data is 26.1 MB per page, in 8-bit greyscale 8.7 MB, and as 1-bit black-and-white 1.09 MB. JPEG at a scanner’s default quality brings the colour version to roughly 5 percent of raw — about 1.3 to 1.5 MB — which is exactly the per-page figure of the 60 MB contract. Nothing else in the table gets near that number unless something has gone wrong.

How to tell which case you are in

Start with size per page. Under 50 KB a page there is nothing worth recovering; 200–500 KB means compressed images or heavy fonts; over 1 MB a page is almost certainly a colour scan. Then check whether the text is real: press Ctrl+A (Cmd+A on a Mac) in any viewer. Native text highlights line by line; a scan highlights as one rectangle or selects nothing. Poppler’s command-line tools and qpdf answer the rest:

pdfinfo contract.pdf              # Pages, Page size, File size, Optimized, Tagged
pdftotext contract.pdf - | head   # no output at all = scanned, no text layer
pdfimages -list contract.pdf      # one row per image: pixels, colour, codec, ppi, bytes
pdffonts contract.pdf             # emb and sub columns: embedded? subset?
grep -ac '%%EOF' contract.pdf     # 1 = single revision; 3 or more = old saves still inside
qpdf --list-attachments contract.pdf

Read pdfimages -list carefully. A scanned page shows one row like 1 0 image 2480 3508 rgb 3 8 jpeg no 12 0 300 300 1467K 5.6%: 2480 × 3508 pixels, RGB, JPEG, 300 ppi, 1.47 MB, 5.6 percent of raw. The enc column is the diagnosis: jpeg and jpx are already lossy; ccitt and jbig2 are bilevel and about as small as they get; image means Flate or nothing, the best case, because shrinking it costs no quality. A grep count of 2 is normal for a linearised file (pdfinfo shows Optimized: yes); 3 or more means earlier saves are still inside.

Native PDFs: shrink them without rasterising

A native PDF — exported from Word, LibreOffice, LaTeX, InDesign or a browser — has real text, and the only heavy things in it are the placed pictures and the fonts. The fix is to downsample the pictures and subset the fonts while leaving the text alone.

Word and LibreOffice

Word stores pictures at the resolution under File → Options → Advanced → Image Size and Quality, 220 ppi by default; the Do not compress images in file box keeps originals at full size, which is how a 12-megapixel photo printed 6 cm wide stays 12 megapixels. Select a picture, open Picture Format → Compress Pictures and apply Web (150 ppi) to all pictures, then in Save As → PDF → Options choose Minimum size (publishing online). LibreOffice’s Export as PDF dialog has the same two controls: a JPEG quality slider and Reduce image resolution.

LaTeX

pdfTeX already does the cheap things — TeX Live sets \pdfcompresslevel=9 and \pdfobjcompresslevel=2, and fonts are subset — but \includegraphics passes a JPEG through byte for byte and stores a PNG as Flate at its full pixel count. Resample figures before including them: magick figure.png -resize 1240x figure-small.png is a page-wide figure at 150 dpi on A4.

Ghostscript and qpdf for any native PDF

When all you have is the PDF, Ghostscript’s pdfwrite device rewrites it with images downsampled and fonts subset, and the text stays text:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -dQUIET -sOutputFile=out.pdf in.pdf

/screen downsamples images to 72 ppi, /ebook to 150, /printer and /prepress to 300. /ebook is right for anything read on a screen and cuts image data to about a quarter of a 300 ppi original, because halving resolution quarters the pixel count. For finer control use -dDownsampleColorImages=true -dColorImageResolution=150 (plus the Gray and Mono variants), and -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray to drop colour. Two things do not survive: digital signatures, which any change invalidates, and form fields, which come out flattened. For a lossless pass that drops old revisions and packs objects into compressed streams without touching an image, use qpdf — expect single-digit percentage gains unless grep reported a stack of revisions:

qpdf --object-streams=generate --recompress-flate --compression-level=9 in.pdf out.pdf
qpdf --remove-attachment=draft-v3.docx --replace-input out.pdf

Scanned PDFs: resolution, colour depth and codec

A scan has no text to preserve, so everything comes down to three choices per page: how many pixels, how many bits per pixel, and which codec.

Page contentColour modeCodec (PDF filter)Where it lands
Typed text, forms, line drawings1-bit black and whiteCCITT Group 4 (/CCITTFaxDecode) or JBIG2 (/JBIG2Decode)Tens of KB per page at 300 dpi
Text with stamps, pencil, poor contrast8-bit greyscaleJPEG (/DCTDecode) at quality 50–70, 200–300 dpiA few hundred KB per page
Photographs, colour brochures24-bit RGBJPEG at quality 60–75, 150–200 dpi, or JPEG 2000 (/JPXDecode)200 KB to 1 MB per page
Text over photos or coloured paperMRC layersJBIG2 text mask over a low-resolution JPEG backgroundClose to the text-only figure

Colour depth is the biggest lever: RGB to greyscale divides the raw data by three, 1-bit by 24, before the codec starts. CCITT G4 (ITU-T T.6) is lossless; JBIG2 (PDF 1.4 and later) typically halves G4 again by recognising repeated glyph shapes. JBIG2’s lossy symbol-matching mode will substitute one glyph for a similar one — in 2013 Xerox WorkCentre scanners were found turning 6s into 8s this way — so keep it in lossless mode for anything with numbers, or use G4.

Resolution trades against OCR. Tesseract’s documentation asks for 300 dpi; 200 still recognises clean print; below about 150 the x-height of 10-point text drops under ten pixels and accuracy collapses. Scan at 300 dpi and let the codec shrink it: a 300 dpi G4 page costs only a few tens of kilobytes more than a 100 dpi one, and the second cannot be read by machine. The OCR guide covers what the recogniser needs.

Mixed raster content (MRC) is what professional scanning software does with a page of text and pictures: a full-resolution 1-bit mask holds the text edges, a foreground layer the text colours, and a low-resolution JPEG background the paper and photos. Text stays crisp and the page costs little more than text alone. Acrobat’s scan optimiser and the “compact” or “high compression” PDF option in most scanner software produce it; no browser tool on this site does. The practical version is to choose greyscale or black-and-white at the scanner for text pages — the scanning guide walks through those settings.

What our compressor does, and what it throws away

Compress PDFtakes one route, the one that reliably shrinks scans inside a browser: it renders every page with pdf.js at a fixed resolution, encodes it as a JPEG, and builds a new document with pdf-lib in which each page is that single JPEG drawn at the original page size in points. The output is, in effect, a scan of your PDF, produced in the tab, so the contract is never uploaded. That is exactly right for a document that was already a scan and exactly wrong for a text-born PDF, where a few kilobytes of vector text become hundreds of kilobytes of pixels — the tool’s own FAQ warns the file can grow.

PresetRender resolutionJPEG qualityPixels for an A4 page
Light (best quality)150 dpi0.80≈ 1240 × 1754
Balanced110 dpi0.70≈ 909 × 1286
Strong (smallest)72 dpi0.50≈ 595 × 842

The optional Target size (KB) box turns the preset into a starting point. The tool then renders the document up to five times down a ladder — the preset as it is, the same resolution at quality 0.45, then 75 percent of the resolution at 0.40, 55 percent at 0.35 and 40 percent at 0.30 — and stops at the first rung that fits. If the last rung misses you get the smallest attempt and the notice The target size could not be fully reached; the smallest possible version was saved. Start from Light when you have a target: from 150 dpi the last rung is still 60 dpi, whereas from Strong it is 29 dpi, which is unreadable. The target counts binary kilobytes (1 KB = 1024 bytes) and portals sometimes count thousands, so leave three to five percent of headroom. The result line reads like 2.4 MB → 310 KB — download started.

The rebuild removes everything that is not pixels: the text layer, so nothing can be selected, searched or read by a screen reader; links, bookmarks, form fields, annotations, attachments, layers, tags and metadata. It keeps the page count and the exact page dimensions, so the result prints at the same size. One file downloads as name_compressed.pdf; several come back as compressed.zip. A file that fails with Could not compress. The file may be corrupted or password-protected. usually has an open password: remove it with Unlock PDF, which needs the current password and writes a _unlocked.pdf copy (the passwords guide explains which kind of protection you have). If you need searchable text on the compressed scan, run OCR on the result, not before — the rebuild would discard the text layer.

Two other routes: images in, page images out

Sometimes the PDF has not been made yet, and the cheapest compression happens before it exists. Image to PDF builds one page per picture, in the order you arrange with the arrow buttons, and embeds JPEG and PNG files byte for byte — no recompression, so the PDF is the sum of the image files plus a few kilobytes. Resize and JPEG-encode the photos first, following the image compression guide, and a ten-page receipts PDF lands wherever you aimed. Two consequences: formats pdf-lib cannot embed, such as WebP or AVIF, are decoded and stored as lossless PNG, which can turn a 200 KB WebP into a multi-megabyte page, so convert those to JPEG first; and each page is sized to the image’s pixels in points, so a 4032 × 3024 photo becomes a 56 × 42 inch page that viewers scale to fit — fine for uploads, but pixel count, not paper size, is what you control. An image the browser cannot decode, such as HEIC on most non-Apple systems, stops the build with Could not build the PDF. One of the images may be in a format the browser cannot decode.

When a portal wants a picture of a page rather than a document, PDF to JPG renders each page at twice its nominal size — about 1190 × 1684 pixels for A4, 1224 × 1584 for US Letter, the equivalent of 144 dpi — as a JPEG at quality 0.92. A single page downloads as name_page_1.jpg; a multi-page file arrives as name_pages.zip, and several PDFs together as converted_pages.zip. For one page of a long document, extract it first with Split PDF, whose Pages box takes 1-3, 5, 8-10 and writes name_extracted.pdf.

Hitting a specific limit

Upload limits cluster into three bands, each with a natural route.

DestinationTypical capRoute
Email attachments20–25 MB (Gmail: 25 MB)Ghostscript /ebook for native files; Balanced preset for scans; or two messages
Job, university and tender portals2–5 MB per fileLight preset with the cap as target; appendices as separate uploads
Government forms, visa and ID uploads200 KB – 1 MB, sometimes per pageScan greyscale at 200–300 dpi; Light preset with the target 5 percent under; split when it still misses

Work the arithmetic first. A 300 KB cap on a four-page ID scan is 75 KB a page. At Balanced resolution an A4 page is 1.17 million pixels and a JPEG of a text page at quality 0.7 is typically well over 100 KB, so expect the ladder to step down two or three rungs, to 82 or 60 dpi, before it fits; set the target to 290 and let it search. A 300 KB cap on a 20-page statement is 15 KB a page, which no full-page JPEG can meet legibly: split out the pages the form actually asks for, or rescan the text pages in black and white so the scanner writes G4 or JBIG2 at a few tens of kilobytes each. The merge and split guide covers pulling ranges apart without re-encoding anything.

Common mistakes

  • “Printing” to PDF to shrink it.Microsoft Print to PDF and other print drivers re-encode images at the driver’s resolution rather than smaller, re-embed every font and drop hyperlinks, bookmarks and tags. Use the application’s own export or Ghostscript.
  • Compressing a compressed file again. JPEG loses detail on every generation. A scan through Balanced twice is blurrier and barely smaller; go back to the original and choose a stronger preset or a target.
  • Rasterising a text-born PDF. A Word export through a page-rendering compressor loses search, copy and accessibility, and often grows. If pdftotextprints real text, use Ghostscript or the exporter’s settings instead.
  • Stripping fonts. -dEmbedAllFonts=false saves tens to hundreds of kilobytes per font and lets every viewer substitute its own, shifting line breaks and breaking anything non-Latin. Subsetting, the default, is the safe saving.
  • Leaving old revisions and attachments in.Acrobat’s Save appends; only Save As rewrites. A form saved twenty times carries twenty revisions, and some Word-to-PDF tools attach the .docx. Check with grep -ac '%%EOF' and qpdf --list-attachments.
  • Setting the target with no headroom.A limit of “1 MB” may mean 1,000,000 bytes on the server while the tool counts 1,048,576. Target 970 KB, not 1024.

Do this

  • Divide file size by page count, then run pdfimages -list: over 1 MB a page with one RGB image per page is a colour scan.
  • Native PDF: export again with images at 150 ppi and fonts subset, or rewrite with gs -dPDFSETTINGS=/ebook; run qpdf --object-streams=generate to drop old revisions.
  • Scanned PDF: Compress PDF, Light preset, target a few percent under the cap; accept that the text layer is gone and OCR afterwards if you need it.
  • Building from photos: resize and JPEG-encode first, then Image to PDF — it embeds the bytes unchanged.
  • Still too big: split into the pages the form asks for, or rescan text pages in greyscale or black and white at 300 dpi.
  • Always work from the original; never compress a compressed copy.

Frequently asked questions

Why is my PDF so large?

Almost always because of images. A colour scan of one A4 page at 300 dpi is 8.7 million pixels and 26 MB before compression, so even as a JPEG it is 1–2 MB per page. Run pdfimages -list on the file: if it shows one full-page RGB image per page, that is where the bytes are. Fonts, metadata and old revisions rarely add up to more than a few megabytes.

Does compressing a PDF reduce its quality?

It depends on the method. A lossless rewrite (qpdf, or Ghostscript without downsampling) changes nothing you can see. Downsampling images to 150 dpi or re-encoding them as JPEG is lossy, and rasterising a page — what the Compress PDF tool on this site does — turns the text into pixels, so it can no longer be selected or searched.

Why did my PDF get bigger after compressing it?

The file was text-born rather than scanned. Vector text costs a few bytes per character, but a full-page JPEG of that text costs tens or hundreds of kilobytes, so rendering pages to images grows a small text PDF. Use Ghostscript with -dPDFSETTINGS=/ebook or Word's "Minimum size" export for those files instead.

What DPI should I scan at to keep PDFs small?

300 dpi in black-and-white or greyscale for anything you may want to OCR later; 200 dpi is the practical minimum for recognition. Use colour only for pages that actually contain colour. Greyscale is a third of the raw data of colour at the same resolution, and 1-bit black-and-white with CCITT G4 or JBIG2 is smaller again by a large margin.

How do I compress a PDF to under 200 KB?

Open it in Compress PDF, choose the Light preset and enter a target a few percent below the limit, for example 190 for a 200 KB cap. The tool steps down quality and resolution until the file fits. If it reports that the target could not be reached, split the document with Split PDF and compress the parts separately, or rescan the pages in greyscale at 200 dpi.

Tools used in this guide

Every one of these runs in your browser — the files you work on never leave your device.

More pdf guides