PDF Shrink

How the compressor works

A plain-English (and a bit technical) explanation of what happens to your PDF — all of it inside your browser.

Key facts

Smart mode (default)

We parse the PDF into its objects, walk the object graph from the document catalog and drop everything that isn't reachable — leftovers from previous edits. We remove metadata and embedded page thumbnails, compress any uncompressed streams with zlib, then look at each image. Supported images (JPEG, and 8-bit RGB or grayscale Flate images, including PNG-predicted ones) are decoded with the browser's own decoder, resized so the longest side fits the chosen limit, and re-encoded as JPEG. If the new version isn't smaller, the original image is kept. CMYK, indexed-colour and masked images are left untouched to avoid colour shifts.

Exact-size mode

Given a target like 100 KB, we first try lossless cleanup. If that isn't enough, we binary-search an 8-step ladder from high quality (JPEG 82%, 2600 px) to low (20%, 620 px), keeping the best result under the target. If even the lowest step is too large — for example because the PDF contains many vector-heavy pages — we render each page with pdf.js and binary-search resolution (150 → 44 DPI) and quality. The result tells you which path was used.

Safety

We never return a file larger than your original. PDFs with security restrictions are flattened rather than modified, because rewriting them in place would break their encryption.

Frequently asked questions

Is the source code available?

The app is plain HTML and JavaScript; you can read every line in your browser's developer tools.

Are my PDFs uploaded to a server?

No. Compression runs entirely inside your browser using JavaScript and WebAssembly-grade libraries. Your file never leaves your device, so confidential documents stay private. You can even disconnect from the internet after the page loads and it keeps working.

More free PDF tools

Last updated