Compress PDF to a Target Size

Shrink a PDF (or a photo of a document) down to an exact KB or MB limit — perfect for exam and job portals with strict upload caps. Nothing ever leaves your browser.

What is the Compress PDF Tool?

Compress PDF shrinks an existing PDF (or a photo of a document, converted automatically) down to a target file size you choose in kilobytes or megabytes — built for the all-too-common situation where a government exam portal, job application, or visa form caps uploads at something strict like 50KB, 100KB, or 200KB, and the scanned certificate or photo you have is several times that size.

Rather than one fixed "high/medium/low" compression level, you tell it the exact size you need and it searches for settings that hit that number as closely as possible without going over — the same target-driven idea as "compress to fit" features in desktop PDF software, just running entirely in your browser.

How to use it

  1. Drop in a PDF, or a JPG/PNG/WEBP photo of a document — an image is automatically wrapped into a one-page PDF first, so the rest of the tool works the same either way.
  2. Enter a target size in KB, or click one of the quick preset buttons (50KB, 100KB, 200KB, 300KB, 500KB, 1MB) if your form states a specific limit.
  3. Click "Compress" and wait a few seconds — a progress bar shows while each page is re-rendered and re-compressed in the background.
  4. Check the before/after size and the page 1 preview, rename the file if needed, and click "Download PDF".

How it works, and why it's private

Every page of the PDF is rendered to a canvas using pdf.js (the same engine Firefox uses to display PDFs), then re-encoded as a JPEG and reassembled into a brand-new PDF using pdf-lib — this is what actually shrinks the file, since a page full of vector text and fonts becomes a single compressed image instead.

To find the right settings, it runs a binary search on JPEG quality first, always trying the lightest compression (highest quality) before anything heavier — a text-heavy page stays sharp whenever the target size allows it. Only if quality alone can't reach the target even at its lowest setting does it also start lowering the page's render resolution in steps, repeating the quality search at each one, until the result fits under the target or every option has been tried.

All of this — reading the PDF, rendering its pages, compressing, and rebuilding the output — happens inside your browser using pdf.js and pdf-lib. Nothing is ever uploaded to a server, which matters for ID documents, mark sheets, and other sensitive paperwork people run through this tool.

Example

A 1.4MB, 3-page scanned certificate, target 200KB:

Quality search at full resolution can't get under 200KB even at its lowest quality setting
Render resolution drops one step, quality search runs again at that lower resolution
Result lands at 188KB — under target, with quality kept as high as that resolution allowed
Page 1 preview confirms the text is still legible before downloading

Frequently asked questions

Is my PDF or photo uploaded anywhere?

No — every step (rendering pages, compressing, and rebuilding the file) happens locally in your browser using pdf.js and pdf-lib. Nothing is ever sent to a server, which is important for ID proofs, certificates, and other sensitive documents.

Can I compress a photo, not just a PDF?

Yes — drop in a JPG, PNG, or WEBP image and it's automatically wrapped into a one-page PDF first, then compressed the same way as an uploaded PDF.

Why does the text look blurry after compressing to a very small size?

Every page is converted into a compressed JPEG image to shrink the file, and at very strict targets (well under 100KB on a multi-page document) that can mean lowering both JPEG quality and resolution — the tool warns you when that happens. If your form's limit allows it, pick a slightly larger target for a sharper result.

Can this GUARANTEE hitting the exact target size?

It gets as close as possible without going over, trying the lightest compression first — but an unusually strict target on a page-heavy or image-heavy PDF may not be reachable at any readable quality, in which case it returns the smallest result it could produce and flags it clearly.

Does compressing lose the original PDF's text layer (searchable/selectable text)?

Yes — because every page is flattened into a JPEG image to shrink the file, the output is no longer searchable or selectable the way the original PDF's text might have been. This trade-off is what makes the large size reduction possible.