How to compress a PDF
- Drop your PDF into the zone above, or click to browse and select it.
- Choose your optimisation options. Remove metadata strips the document title, author, creation date, and other invisible properties. Remove annotations removes comments and markup added to the document.
- Click Compress & download. The tool shows the before and after file sizes, and the optimised PDF downloads to your device.
Everything runs in your browser using pdf-lib.
No file is sent to a server — open DevTools (F12) → Network while processing to verify zero upload requests.
When to compress a PDF
- Email attachments — many email providers cap attachments at 10–25 MB. Stripping metadata and unused resources can bring a bloated PDF under the limit.
- Document portals and upload limits — government portals, insurance sites, and HR systems often impose strict file size limits on uploads.
- Removing author metadata before sharing — a report created in Word carries author name, company, and revision history in the PDF metadata by default. Stripping it before sending removes that information.
- Cleaning up PDFs exported from design tools — Illustrator and InDesign exports often include significant metadata overhead that contributes nothing to the document content.
- Archiving — removing unused objects and annotations produces a cleaner, more compact file for long-term storage.
How it works under the hood
pdf-lib loads the PDF and rewrites it with the useObjectStreams: true option, which compresses
the document's cross-reference table — an internal index of all objects in the file. This alone can reduce
file size by several percent for PDFs with many objects.
Stripping metadata removes the document information dictionary, which stores title, author, subject, keywords, creator, and producer fields. These are invisible to readers but add bytes to every copy of the file. Removing annotations deletes the annotation arrays attached to each page — comments, highlights, and markup left by reviewers.
What this tool does not do: re-encode embedded images at lower quality. Image data is the dominant source of file size in most PDFs, and reducing it requires re-rendering images at a lower resolution — a process that can only be done well with tools like Ghostscript. A server-based compression tool is more effective for image-heavy PDFs; we plan to add this as an optional cloud processing feature.
Limits and what to expect
- Image-heavy PDFs: if most of the file size comes from embedded images, this tool will produce minimal reduction. The largest size wins require re-encoding images, which this tool does not do to preserve quality.
- Already-optimised PDFs: PDFs exported from modern tools with compression already applied may see little or no size reduction.
- Password-protected PDFs: must be unlocked before use.
- Annotation removal scope: removes standard annotations (comments, highlights, sticky notes). Interactive form fields are not removed by the annotations option.
- Browser support: Chrome 90+, Firefox 90+, Safari 15+, Edge 90+.
Privacy compared to other PDF compressors
Online PDF compressors upload your file to a server, compress it there, and serve it back. The irony is that compressing a sensitive document — a contract, financial report, or patient record — on a third-party server exposes it to the same risks as any other upload. You are trusting a company you have never audited with your most private documents.
keptlocal compresses entirely in your browser. The PDF bytes move from your disk to your browser's memory, get optimised, and download back to your disk. No server is involved. Verify it in the Network tab — zero outbound file transfers.