inyourbrowser.com

Compress PDF

PDF compressor is a browser-based tool that reduces PDF file size. It offers a lossless mode that repacks the file and drops objects it no longer uses, 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 rewrites the file with compressed object streams and leaves out objects nothing in the document refers to, such as leftovers of earlier saves (no quality loss). It does not de-duplicate images or subset fonts. High, Medium, and Low modes render each page with pdfjs-dist at scale 1.5x, 1.2x, or 0.9x (108, 86, or 65 dpi) and embed it as a JPEG with quality 0.85, 0.7, or 0.55 in a new document, on a page the same size as the original.
  • Browser API or library: pdf-lib 1.17 for object writing, pdfjs-dist 6.3 for rendering. Both are bundled with the site and loaded when the tool needs them.
  • Input limits: PDFs capped at 100 MB to keep parsing inside browser memory budgets.
  • Output: PDF blob with a download button, accompanied by a before-and-after size badge. When the result is not smaller than the original, the tool says so and offers no download. Lossless mode keeps the document properties (title, author, XMP, file ID); the other modes write a new file with empty document properties and a random file ID.
  • Known limitations: Re-render modes flatten text to images, so the result is no longer text-selectable, and links, bookmarks, and form fields are dropped. Lossless mode keeps comments, form values, attachments, and hidden-layer content as they are. Encrypted PDFs cannot be re-saved without the password.

Frequently asked questions

How much smaller will my PDF get?
Scans and image-heavy PDFs usually shrink the most, because High, Medium, and Low redraw every page as a JPEG image. Lossless mode only repacks the file's objects, so a text-only PDF may shrink a little or not at all. When the result is smaller, the tool shows the original and compressed sizes before you download; when it is not, it says so and offers no download. All processing runs in your browser using pdf-lib and PDF.js.
Is my PDF uploaded to a server?
All compression happens in your browser using pdf-lib and PDF.js. Our servers are not involved at any point.
What does Lossless mode do?
Lossless mode rewrites the PDF with compressed object streams and leaves out objects the document no longer uses, such as leftovers of earlier saves. It never degrades image quality or removes visible content.
What happens if the PDF does not get smaller?
The tool tells you and offers no download, because the file is already well optimised. Lossless mode often finds little to remove in such files; for scanned or image-heavy PDFs, try a lower quality mode.
Will compression make text unselectable?
Only the image re-rendering modes (High, Medium, and Low) affect text, as pages are converted to JPEG images. Lossless mode preserves all text as fully selectable.

Related tools

Merge PDF
Combine multiple PDF files into one downloadable PDF. Drop in your files and reorder them with arrows. Runs in your browser.
Split PDF
Extract specific pages or page ranges from any PDF. Download the result instantly.
Image to PDF
Convert JPG, PNG, WebP, or GIF images to a PDF. Add multiple images, reorder, download instantly.
Edit PDF metadata
View, edit, or strip the title, author, subject, dates, and creator embedded in a PDF. Runs in your browser.
Compress image
Reduce JPEG, PNG and WebP size with a quality slider. Compression runs in your browser.

Reviewed and tested September 30, 2026.