Compress PDF Online

Reduce PDF file size locally in your browser using qpdf WASM. Choose standard or web-optimised compression, then download the new PDF.

What This Compressor Can - and Cannot - Shrink

This tool uses qpdf to rewrite the internal structure of a PDF. It can compress eligible streams, place eligible objects into compressed object streams, and discard certain unused resources. Those changes can reduce structural overhead without intentionally reducing image resolution.

That is different from an aggressive image compressor. This component does not downsample images or deliberately convert embedded images to lower-quality JPEGs. If most of a PDF's size comes from already-compressed photographs or scans, the file may shrink only a little - or the rewritten file may even be larger.

A smaller result is therefore not guaranteed. The before-and-after sizes shown by the tool are the result of the actual qpdf rewrite, not an estimated compression percentage.

Standard vs Web-Optimised Mode

Standard

Rewrites compressible stream data, generates PDF object streams, and lets qpdf automatically decide whether an expensive unused-resource scan is worthwhile. This is the better default when you mainly want a compact structural rewrite.

Web-optimised

Adds recompression of existing Flate streams at compression level 9 and linearises the output. Linearisation rearranges PDF data so compatible readers can begin displaying pages before the whole file has downloaded; it is not a promise that the final file will be smaller than Standard mode.

Why a PDF Can Get Bigger After "Compression"

PDF is a container format, and many PDFs are already efficiently compressed when they are created. Rewriting object streams, recompressing Flate data, or adding linearisation structures changes the byte layout. Depending on the original file, those changes do not always produce a net saving.

This is especially common when the source is dominated by JPEG images, scanned pages, or a PDF generator that already used compact object streams. In those cases, qpdf can still produce a structurally rewritten file without meaningfully reducing the large image payload.

If the result is larger, the tool reports that honestly rather than calling the increase a compression saving.

What Happens in the Browser

  1. The PDF is read locally: the selected browser File is loaded into memory so PDF.js can inspect its page count.
  2. qpdf WASM is loaded: the qpdf WebAssembly module is initialized in the browser and reused for later runs on the same page.
  3. The PDF enters WASM memory: a temporary /input.pdf is written to qpdf's in-memory filesystem.
  4. qpdf rewrites the document: the selected qpdf options generate /output.pdf.
  5. The output is copied back out: the bytes are copied into browser-owned memory before both temporary WASM files are deleted.

The qpdf callMain() supplied by this WASM package is synchronous, so the intensive qpdf portion can temporarily occupy the browser's main thread on large or complex PDFs. The progress bar represents processing stages rather than byte-by-byte qpdf progress.

PDF Compression Questions

Does this upload my PDF?

This component does not send the selected PDF to a compression server. It reads the browser File locally and runs qpdf through WebAssembly in the page.

Does it reduce image quality?

Not deliberately. The configured qpdf modes perform structural and Flate-stream compression; they do not request image downsampling or lossy JPEG optimisation.

Why did qpdf report a warning but still give me a file?

qpdf distinguishes warnings from hard errors. A warning-only run can still produce output. This tool marks that result clearly so you can open and review it before relying on the rewritten PDF.

What does linearising a PDF do?

It reorganises the PDF for incremental network access so a compatible reader may start displaying it before the complete file has arrived. Linearisation is about delivery layout, not simply stronger size reduction.

Can it compress a PDF that requires a password?

This interface has no password field. A PDF that requires a non-empty password cannot be supplied that password here, so qpdf will fail to open it. Files whose encryption can be opened without an additional password may behave differently.

Will encryption be removed from an encrypted PDF?

The qpdf command used here does not request decryption. qpdf normally preserves input encryption when rewriting unless decryption is explicitly requested, but password-requiring files are not supported by this interface.

Should I use this on a digitally signed PDF?

Not if preserving signature validity is important. This tool rewrites the PDF bytes, so a signed document should be treated as a special case and verified in your signature workflow instead of assuming the signature will remain valid.

Why might a very large PDF make the page feel busy or briefly unresponsive?

The PDF exists in browser memory and is copied into the WASM filesystem for qpdf. The qpdf call exposed by this package is synchronous, so CPU-heavy processing can occupy the main browser thread until that call returns.

Related Tools