keptlocal
Files never leave your browser

Compress PDF

Upload a PDF, choose what to strip, and download a leaner file instantly. Best for PDFs bloated with metadata or unused resources. Nothing is uploaded.

Drop a PDF here, or

Files never leave your browser.

Drop a PDF to compress it.

How to compress a PDF

  1. Drop your PDF into the zone above, or click to browse and select it.
  2. 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.
  3. 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.

Frequently asked questions

Are my files uploaded to a server?
No. All processing runs in your browser using pdf-lib. Your PDF never leaves your device.
How much will the file size be reduced?
It depends on the PDF. Documents with heavy metadata, form field data, or unused embedded resources can reduce significantly. PDFs that are already well-optimised may see minimal change. For image-heavy PDFs, the biggest size reductions require re-encoding images at lower quality — this tool does not re-encode images to preserve visual quality.
What does 'remove metadata' do?
Metadata includes the document title, author, creation date, software that created it, and custom properties. Stripping this removes those fields from the file — useful for privacy and for slightly reducing file size.
Why is the size reduction smaller than I expected?
Browser-based PDF compression removes metadata and unused document objects. For more aggressive compression — particularly re-encoding embedded images at lower quality — server-side tools using Ghostscript achieve much higher reductions. We plan to add a cloud-processing option for this in a future update.
Will content or quality change?
No visible content changes. Text, images, and formatting are preserved. Only invisible overhead (metadata, unused resources) is removed.
Is there a file size limit?
No hard limit. The practical ceiling is your device's available RAM.