How PDF Compression Works
PDF files can be large for several reasons: high-resolution embedded images, uncompressed content streams, duplicate objects, and extensive metadata. This tool addresses all of these sources in the browser using pdf-lib, a pure JavaScript library.
What This Tool Does
- Stream compression — All uncompressed content streams are rewritten with deflate (zlib) compression, which is lossless and the most universal PDF compression method.
- Image re-encoding — Embedded JPEG and PNG images are re-encoded at lower quality using the browser's canvas API. This is the biggest source of file size reduction in photo-heavy PDFs.
- Metadata removal — Title, author, creator, subject, and keyword metadata can be stripped to save a small amount of space and improve privacy.
- Annotation removal — Optional. Removes embedded comments, highlights, and ink annotations.
- Object deduplication — pdf-lib automatically removes redundant cross-reference tables and linearization data when rewriting the file.
Why Might My PDF Not Shrink Much?
PDFs that are mostly text and vectors will compress less than photo-heavy PDFs because text is already compact. If your PDF was already compressed by another tool, further compression may yield minimal results. Scanned PDFs with large JPEG images benefit the most from this tool.
Privacy
This tool runs 100% in your browser using pdf-lib loaded from cdnjs. Your files are never sent to any server and never leave your device.