Compress a PDF to an exact size
Government portals and visa forms do not ask for a smaller PDF, they ask for a number. Type that number and the tool works backwards until the file is under it.
How Compress PDF to Size works
The file is read with a FileReader, rewritten in memory and offered as a download. This is why large PDFs are limited by your device's RAM rather than by an upload size limit. A 200 MB scan never crosses the network, so the slowest part is your own disk.
That is the whole architecture: static files, one script, no upload endpoint to leak or log. Close the tab and the work is gone.
Why the limit exists, and why it is a number
Visa portals, government forms, university admissions and job applications rarely say “make it smaller”. They say 200 KB, or 500 KB, or 2 MB. That turns compression from a quality question into a search problem: find the highest quality whose output still fits under a threshold.
Quality and file size are monotonically related — lower JPEG quality always means fewer bytes — so a binary search converges in about six rebuilds. Between 32% and 92% quality, six halvings of the interval land within a fraction of a percent of the largest file that still fits.
What is thrown away to get there
Each page is rendered once at twice its natural resolution and kept as a canvas. Every attempt then scales that canvas and re-encodes it as JPEG, which changes both the pixel count and the quantisation table. When even 32% quality at 42% scale is too large, the file genuinely cannot hold that much information and the tool says so rather than shipping a grey mush.
The trade is visible: at 42% scale a 300 dpi scan becomes roughly 126 dpi, which is fine for reading and poor for printing. A text-only document can usually hit 200 KB at full scale because text compresses well; a scan of colour photographs cannot, because there is no redundancy left to remove.
The catch: the text layer dies
Re-rendering pages as images removes the text layer, so the result cannot be selected, searched or copied — and a form's fillable fields are flattened with it. There is no way around that: an exact byte target and a preserved text layer are competing goals, and the byte target wins whenever a portal is checking it.
If you need both, the fix is a second pass: compress here to satisfy the upload limit, then run the file through Make a scanned PDF searchable, which adds an invisible OCR text layer back on top without touching the size much.
No task limit, because there is no server
Smallpdf's free tier stops after two tasks a day and caps uploads at 5 MB; iLovePDF caps files per task. Those limits exist because the file is uploaded to a machine they pay for. This runs in your tab with the same pdf.js and pdf-lib that a server would use, so there is nothing to meter and no queue to wait in.
Good to know
- Works offline once loaded, including on flights and in locked-down networks.
- No file size limit beyond your device's own memory.
- Free to use, with no account and no usage counter.
- Results are produced locally, so they are not logged or shared with anyone.
Questions
How does it hit an exact size?
It renders each page once at high resolution, then rebuilds the PDF at progressively lower scale and JPEG quality, binary-searching the quality that lands just under your limit. Five or six rebuilds is normal.
Will the text still be selectable?
No. Reaching a hard size limit means re-rendering the pages as images, which removes the text layer. If you need both a small file and selectable text, run Make a scanned PDF searchable afterwards to put an invisible text layer back.
Is there a file-size or task limit?
No. Smallpdf's free tier stops after two tasks a day with a 5 MB cap; this has neither, because nothing leaves your machine and there is no server to meter.
What if it cannot get small enough?
The tool tells you the smallest it reached and suggests splitting the document. A 40-page scan of colour photographs cannot honestly become 100 KB.
Keep going
More files tools
Searchable PDF
Add an invisible text layer to a scanned PDF so Ctrl+F, copy and paste work again. OCR runs in the tab; English, Urdu, Arabic and Hindi are supported.
Open toolVideo Aspect Ratio Converter
Turn a landscape clip into a Reels, Shorts or TikTok frame. Keep the whole shot over a blurred copy of itself, or fill the frame and crop.
Open toolAudio Denoiser
Cut fan hum, street noise and microphone hiss out of a recording. The noise profile is measured from the quiet parts, then subtracted. Outputs WAV.
Open toolPDF N-up
Turn a long PDF into a printable handout: 2, 4, 6 or 9 pages per A4 sheet, with margins you control. No watermark, no page cap, no upload.
Open toolPDF Metadata Editor
Read the title, author, subject and keywords stored inside a PDF, change them or clear them completely, and save a clean copy. Pages untouched.
Open toolCSV to JSON
Convert CSV data into clean JSON with a custom delimiter, header detection and pretty or compact output.
Open tool