inyourbrowser.com

Compress PDF

PDF compressor is a browser-based tool that reduces PDF file size. It offers a lossless mode that strips structural overhead, a re-render mode that rasterises pages at controllable quality, and a side-by-side size comparison before download. The tool runs in your browser.

Drop a PDF here or click to browse

How to compress a PDF

  1. Drop your PDF onto the upload area or click to browse.
  2. Choose a compression level. Lossless for maximum quality, or Medium or Low for smaller files.
  3. Click "Compress PDF" and wait while your browser processes the file.
  4. Download the compressed PDF and check the before and after size comparison.

Common uses

  • Reducing PDF size before emailing it as an attachment to avoid size limits, use merge PDF to combine files first, then compress the result
  • Compressing scanned PDFs to save storage space
  • Shrinking large PDF reports before uploading them to a web portal. Split out the relevant pages first for even smaller file sizes

Technical specification

  • Algorithm or formula: Lossless mode uses object-stream rewriting (no quality loss). Medium and Low modes render each page with pdfjs-dist, then re-embed the rasterised JPEG at scale 1.5x or 1.2x or 0.9x with JPEG quality 0.85, 0.7, or 0.55.
  • Browser API or library: pdf-lib 1.17 for object writing, pdfjs-dist 5.7 for rendering. Both lazy-loaded from npm.
  • Input limits: PDFs capped at 100 MB to keep parsing inside browser memory budgets.
  • Output: PDF blob with a download link, accompanied by a before-and-after size badge.
  • Known limitations: Re-render modes flatten text to images, so the result is no longer text-selectable. Encrypted PDFs cannot be re-saved without the password.

Frequently asked questions

Is my PDF uploaded to a server?
No. Compression happens entirely in your browser using pdf-lib.
What does Lossless mode do?
Lossless mode removes structural overhead and optimises the PDF's internal object streams, it never degrades image quality or removes content.
Why is the compressed file sometimes the same size?
If the PDF is already well-optimised, lossless compression may produce little or no reduction. Try a lower quality mode for scanned-image PDFs.
Will compression make text unselectable?
Only image re-rendering modes (Medium and Low) affect text, as pages are converted to JPEG images. Lossless mode preserves all text as fully selectable.

Reviewed and tested May 26, 2026.