PDF Compressor

Share:

Shrink a PDF — quick lossless mode preserves text, aggressive mode flattens pages to JPEG for the biggest reduction. 100% in your browser.

RT-IMG-019 · Image & File
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 first. If the saving isn't enough, switch to Aggressive — but accept that text becomes part of the image (no copy-paste, no search). Use Aggressive for "share via email / WhatsApp" workflows; use Quick for "keep the document editable."
Drop a PDF to begin.
🔒 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.

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 saved bytes + percentage so you can decide whether to keep the new file or try a different mode.

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 yet

This compressor handles lossless re-save (text-preserving) and aggressive flatten-to-JPEG (text-destructive). It does NOT yet do image-only recompression — extracting individual embedded images from the PDF, re-encoding them at lower quality, and putting them back while preserving the surrounding text. That's the holy grail of PDF compression — biggest savings WITH text preserved — but requires walking pdf-lib's internal object graph in ways the library doesn't expose cleanly. It's on the v2 roadmap. For now, the trade-off is between modest lossless savings and big lossy savings.

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

01

A PDF file is structured as an "object graph" — pages reference fonts, images, and other resources by ID. Compression removes duplicate references and unused objects.

02

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.

03

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.

04

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

05

"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.

06

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.

07

The PDF specification defines filters, not a "compress" operation — every compressor chooses its own mix, which is why results differ so much between tools.

08

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.

09

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.

10

Compressing a PDF that's already heavily compressed can actually MAKE IT LARGER. If Quick mode grows the file, the source was already optimally compressed — use the original.

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 — zero outbound traffic.

  • The source was already optimally compressed. pdf-lib's re-save can occasionally add a few bytes of metadata overhead. If Quick mode doesn't reduce the file, the lossless savings are already exhausted — switch to Aggressive mode if you need a smaller file, or accept that the original is as small as it gets without losing content.

  • Quick mode: 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, always use Quick.

  • Quick mode preserves 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, perfectly readable. 96 DPI for the absolute smallest output (slightly fuzzy text). 200 DPI if the PDF will be printed. Higher DPI = larger output, no visual benefit on screen.

  • 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. 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. A 100-page PDF in aggressive mode takes 30-90 seconds on desktop; the same PDF in Quick takes under a second.

  • Yes on iOS Safari and Chrome on Android. Quick mode is fast on any device. Aggressive mode is CPU-intensive — for a 50+ page PDF on a phone, expect to wait a minute or two. The progress indicator in the status bar updates per page.

Method & sources

How it computes

Quick re-saves with pdf-lib using object streams (keeping metadata); Smart re-encodes, in place, only JPEG images that are plain RGB without a /Decode override; Aggressive renders each page with pdf.js at the chosen DPI and replaces it with a JPEG, refusing to save if a page fails to render or passes 30 seconds.

What this tool implements

  • Smart mode re-encoded every JPEG through a canvas, which writes RGB only: tested 2026-09-29, a red (219, 64, 41) CMYK image came out near-black (8, 5, 21). CMYK and greyscale images are now left alone.
  • Quick mode's own comment said pdf-lib drops unused objects and merges duplicate fonts; tested, a 50 KB orphan stream and a doubled font both survived. It also blanked title, author, subject and keywords unannounced; it no longer does.
  • ISO 32000-1: object streams arrived in PDF 1.5; image filters include DCTDecode, FlateDecode, CCITTFaxDecode, JBIG2Decode and JPXDecode.

Sources

Advertisement
Pre-footer · AD-W3 728 × 90