PDF Compressor

Share:
Image & File

PDF Compressor

Shrink PDFs — lossless or aggressive

By Checked against sources by Last reviewed COMPRESS PDF PRIVACY
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

PDF Compressor

No PDF loaded yet.
💡 Try Quick, then Smart. The panel above says how many images Smart can work on. Switch to Aggressive only if the file must be smaller still and nobody needs its text: it becomes part of the image (no copy-paste, no search). A result that is not smaller is never downloaded unless you ask.
Drop a PDF to begin.
📅 Research current as of 05 Nov 2026 · Sources: ISO 32000-1:2008 filters and object streams (7.4, 7.5.7); pdf-lib 1.17.1 and pdf.js 4.10.38, tested 5 Nov 2026
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.
🔒 PDFs stay on your device. All compression happens in your browser using self-hosted pdf-lib (and pdf.js for the aggressive mode's page-render step). Nothing is uploaded — verify in DevTools → Network.
Advertisement
After results · AD-W1 Responsive · Post-tool — peak engagement

How to compress a PDF

Add your PDF

Drag your file onto the dropzone or click to choose. The tool shows the current file name, page count, and size so you can confirm before compressing.

Pick a mode

Quick (lossless) is the safe default — pdf-lib re-saves the PDF with compressed object streams. Text stays selectable and the pages, images, hyperlinks, form fields and title/author metadata are intact; it does not remove unused objects or merge duplicate fonts, so savings are often small.

Smart re-encodes the photographs inside the file and leaves everything else alone, so text stays text. It only touches plain RGB JPEGs, and keeps a re-encoded image only when it came out smaller.

Aggressive (destructive) flattens every page to a JPEG. File size usually drops the most of the three modes, but the text becomes part of the image — copy + paste and text search no longer work on the output.

Tune aggressive mode if used

DPI controls the resolution of the flattened image: 96 DPI for screen-only viewing, 120 (recommended) for general use, 200 DPI for print quality. JPEG quality slider trades file size for visual sharpness — 75% is the default; compare a page at your chosen setting before sending.

Compress and download

Click Compress and download. The output saves as {original}-compressed.pdf. A result panel shows the original size, the compressed size and the change. If the new file is not smaller, it is held back with a Download it anyway button, because a bigger copy is rarely what anyone wants.

Advertisement
After how-to · AD-W2 Responsive

PDF compression — two completely different operations under one name

"Compress a PDF" sounds like a single operation but it's actually two very different things. Lossless compression changes how the file is stored, not what it shows. Here that means re-saving with object streams — introduced in PDF 1.5, they pack many small objects into one compressed block — so every character, pixel and link survives. How much that saves depends on how the original was written: a file already saved with object streams may not shrink at all.

Destructive compression, by contrast, rebuilds the PDF as a series of compressed images. Each page is rendered to a raster at a chosen DPI and re-encoded as JPEG. The text becomes part of the picture — invisible to copy-paste, search, screen readers, and any downstream document processing. It usually saves the most, because a page of JPEG is small next to the fonts, vector art and lossless images it replaces. The trade-off is permanent.

Which mode should you choose?

Quick mode is the right default for any document that needs to remain editable, searchable, or accessible to assistive technologies. Legal contracts, technical specs, academic papers, anything destined for a knowledge base or compliance archive should always go through lossless compression. Aggressive mode is appropriate when the document is being delivered for visual consumption only — a marketing PDF emailed to a prospect, a presentation forwarded via WhatsApp, a printed report scanned and stored, anywhere the recipient won't need to interact with the text.

Quick mode preserves the document. Aggressive mode preserves the appearance. Pick based on whether the recipient is reading or working with the content.

Why size still matters

Upload portals and email servers cap attachment sizes, and a large PDF costs anyone reading it on a metered mobile plan. Compression is the step between "this document is too large to send" and "this document is ready to share" — check the portal's own limit, since it is the one that counts.

What this tool does — and what it doesn't

Three modes: a lossless re-save, Smart image re-encoding with the text kept, and aggressive flatten-to-JPEG. Smart mode only re-encodes JPEG images stored as plain RGB. It leaves CMYK and greyscale JPEGs alone, because a browser canvas can only write RGB. It also skips images whose EXIF data says to rotate them: a browser applies that rotation and a PDF viewer does not, so the re-encoded picture would come out turned. Images stored losslessly (FlateDecode, the way most screenshots and PNGs end up in a PDF) are not touched. The tool does not remove unused objects, merge duplicate fonts or subset fonts, so a file bloated by those will not shrink much here. It never estimates a saving in advance; the result panel reports the real sizes.

Where PDF bytes actually go: images, object streams and linearisation

01

In most large PDFs the images are where the bytes are — which is why Smart and Aggressive modes, which re-encode images, save far more than Quick. The panel above shows this file's own share.

02

ISO 32000 defines image filters including DCTDecode (JPEG), FlateDecode (zlib), CCITTFaxDecode, JBIG2Decode and JPXDecode (JPEG 2000, PDF 1.5). Aggressive mode turns every page into DCT.

03

Object streams, new in PDF 1.5, pack many small objects into one compressed block — the whole of what Quick mode does.

04

"Linearized" PDFs ("fast web view") store objects in an order that lets the first page display before the whole file arrives; re-saving here does not keep linearization.

05

A re-save through pdf-lib keeps unused objects and duplicate fonts (tested: a 50 KB orphan stream survived), so Quick mode cannot help a file bloated by them.

06

DPI scales pixels with the square: 200 DPI has about 2.8× the pixels of 120 DPI (200² ÷ 120²), so it costs far more than it looks.

07

Smart mode only re-encodes RGB JPEGs: a canvas can only write RGB, and writing it into a CMYK image turned red near-black in testing.

08

A JPEG wrapped in zlib ([/FlateDecode /DCTDecode]) is not a JPEG file until it is unzipped, so Smart mode counts and touches only images stored as plain DCT.

09

Re-saving can make a file LARGER, for example when it was already written with object streams, or more compactly than pdf-lib writes. This tool then holds the result back and tells you, rather than downloading it.

FAQ

  • No. pdf-lib runs in your browser; pdf.js renders pages locally for the aggressive mode. Your PDF is read into memory, compressed in memory, and saved straight back to your downloads folder. Open DevTools → Network and watch: the only requests are for pdf.js and its character maps from this domain, and your file is not in any of them.

  • pdf-lib rewrites every object in the file. If the original already packed its objects into compressed object streams, or was written more compactly than pdf-lib writes, the re-save comes out the same size or bigger; pdf-lib also keeps any unused objects it finds. The tool now holds a result that is not smaller and tells you, instead of downloading it. Try Smart mode if the file has photographs, or keep the original.

  • Quick and Smart modes: yes. The text content is untouched. Aggressive mode: no — text becomes part of a JPEG image. Copy + paste, text search, and screen-reader navigation all fail on the output. For documents that need to remain searchable, use Quick or Smart.

  • Quick and Smart modes preserve them. Aggressive mode flattens pages to image, so form fields and hyperlinks on flattened pages are lost (the visual appearance survives, but they're no longer interactive).

  • 120 DPI for screen viewing and email attachments — small files, readable body text. 96 DPI for the smallest output (text looks softer). 200 DPI if the PDF will be printed or read zoomed in. Higher DPI always means a larger file; on screen the difference shows mainly when you zoom.

  • 75% is the default. Lower settings save more and show more JPEG artefacts, most visibly around small text — try one page at your chosen setting and zoom in before sending.

  • No — not even one that opens without a password. "Restriction-only" protection (an owner password that blocks printing or editing) still encrypts the file's text and images, and pdf-lib, the library this tool uses, cannot decrypt them, so anything it saved would be broken. Since 30 September 2026 the tool says so as soon as you add such a file, instead of producing a file that will not open. Save an unprotected copy first, in software that has the password.

  • The limit is your browser's memory. Quick mode copes with large files; Aggressive mode renders every page, so it is slower and uses more memory — on a phone, start with a smaller file. iPhones and iPads cap a canvas at 4,096 × 4,096 pixels; a page larger than that at your DPI is rendered at the largest size that fits, and the result panel says which pages. If a page fails to render, no file is saved rather than a half-drawn one.

  • Aggressive mode renders each page from scratch via pdf.js, encodes the result as JPEG, then embeds it into the new PDF. That's three operations per page (render, encode, embed) versus a single re-save in Quick, so the time grows with the page count and the DPI. The status line counts the pages as it goes.

  • Yes — tap the drop zone to pick a file. Quick mode is a single re-save. Smart and Aggressive modes decode and re-encode images, which is slow on a phone, so try them on a short document first. The status line updates per image or per page.

Method & sources

How it computes

Quick re-saves with pdf-lib using object streams (metadata kept; Producer and ModDate set). Smart re-encodes in place only plain-DCT JPEGs that are plain RGB, have no /Decode and no EXIF rotation, and decode at the declared size, keeping one only if smaller. Aggressive renders each page with pdf.js at the chosen DPI as a JPEG page. Reports measured before/after bytes; a result that is not smaller is held back.

What this tool implements

  • Corrected 2026-11-05: the analysis panel printed per-mode savings ("~8%", half the JPEG share, 30% + 0.6 x the image share) with no measurement behind them. It now shows only measured figures: image bytes, and how many images Smart mode can re-encode. Savings are reported after the fact from real byte counts.
  • Corrected 2026-11-05: a result larger than (or equal to) the original was downloaded regardless; it is now held back with a "Download it anyway" button. Tested in headless Chrome on a 2-JPEG fixture: Quick grew it by 32 bytes and Aggressive by 18%, and neither was downloaded.
  • Corrected 2026-11-05: Smart mode decoded each JPEG through an <img>, which applies EXIF orientation, while the PDF image keeps its own /Width and /Height. A JPEG carrying EXIF orientation is now left alone, as is any image that decodes at a size other than the one the PDF declares, or that is not stored as plain DCTDecode.
  • Smart mode only re-encodes plain RGB images (DeviceRGB, or ICCBased with N = 3, no /Decode): a canvas writes RGB only, and in testing (2026-09-29) a CMYK red came back near-black.
  • Quick mode loads with updateMetadata: false, so pdf-lib no longer adds a Creator or CreationDate the file did not have; only Producer and ModDate change. It does not drop unused objects or merge duplicate fonts (tested 2026-09-29).
  • ISO 32000-1: object streams arrived in PDF 1.5 (7.5.7); image filters include DCTDecode, FlateDecode, CCITTFaxDecode, JBIG2Decode and JPXDecode (PDF 1.5) (7.4).
Show 1 more
  • A page larger than the browser can hold as a canvas (MDN: iOS limits a canvas to 4,096 x 4,096 pixels) is rendered at the largest size that fits in Aggressive mode, and the result panel names those pages.

Sources

What can make this go out of date

  • None at runtime: pdf.js 4.10.38 and pdf-lib 1.17.1 are vendored and served from this domain, and the JPEG encoder is the visitor's own browser canvas; the file never leaves the browser.
Advertisement
Pre-footer · AD-W3 728 × 90