DEV Community

Cover image for πŸ—œοΈ Compress PDF: Hit an exact target size β€” 100 KB, 300 KB, 500 KB, under 1 MB
Tomaz
Tomaz

Posted on Originally published at tooladda.online

πŸ—œοΈ Compress PDF: Hit an exact target size β€” 100 KB, 300 KB, 500 KB, under 1 MB

⚑ 10-second version

The form says "PDF must be under 300 KB". Most compressors offer "low / medium / high" and let you guess. tooladda.online/pdf-compress.html takes the number instead: you say 300 KB, it searches for the highest quality that fits under it.

❗ Important

Application PDFs are usually your ID, marksheets or bank statements. Compressed locally here β€” no upload, no copy sitting on someone's server after the exam window closes.


πŸ“Š Why your PDF compresses 20Γ— and your friend's barely shrinks

This is the question behind every "compression didn't work" complaint, and the answer is simply what's inside the file:

Your PDF is… Bulk comes from Realistic shrink Why
πŸ“· A phone scan / photo of documents Big JPEGs, often 12 MP each 10–30Γ— You're downscaling and re-encoding huge images. A 6 MB scan hitting 200 KB is normal.
πŸ–¨οΈ A flatbed scan at 600 DPI Oversampled page images 5–15Γ— 600 DPI is print-press territory; 150–200 DPI is plenty for a screen-read application.
πŸ“ Exported from Word / a text PDF Fonts and text objects 1.1–1.5Γ— There are no images to squeeze. Text is already compact. This is the case where compression "fails" β€” and it isn't broken.
πŸ–ΌοΈ A mixed report with charts A few embedded images 2–5Γ— Depends entirely on the image share of the file.

So: if a 90 KB text PDF won't get to 50 KB, that's physics, not a bug. If a 6 MB scan won't get to 200 KB, something's wrong with the settings.

How the target-size mode actually works

Rather than one fixed quality pass, it searches: try a quality/resolution combination, measure the output, adjust, repeat β€” converging on the largest file that still sits under your ceiling. You get the best-looking document that satisfies the limit, instead of a needlessly ugly 60 KB file when 295 KB was allowed.


🧭 How it works

Diagram


✨ What's inside

### 🎯 Target size in KB Presets for 100 KB, 300 KB, 500 KB and 1 MB β€” the numbers real forms ask for β€” plus any custom value you type. ### πŸ” Best-quality search Converges on the largest file under your limit instead of over-compressing to be safe. Your marksheet stays readable.
### πŸ‘€ Before/after comparison Check the output is still legible before you submit it. A 40 KB PDF nobody can read fails the application just as hard as a 4 MB one. ### πŸ”’ Fully local No upload, no queue, no retention. Works on a slow connection because the file never travels.

πŸ› οΈ Where the KB limit bites

Situation Typical limit
πŸŽ“ SSC / UPSC / IBPS applications Documents often 100–500 KB
πŸ›οΈ Government portals Frequently a hard 1 MB or 2 MB per file
πŸ’Ό Job application forms Resume under 1 MB, sometimes 500 KB
🏦 Bank / loan uploads Statements capped per file
πŸ“§ Email attachment ceilings Typically 25 MB total across attachments
🎫 Visa portals Per-document caps as low as 300 KB

πŸ“– Four steps

1.  Open   β†’  tooladda.online/pdf-compress.html
2.  Drop   β†’  your PDF
3.  Target β†’  pick 100/300/500 KB or 1 MB, or type your own
4.  Check  β†’  read the output before submitting, then download
Enter fullscreen mode Exit fullscreen mode

β–Ά Compress now β€” tooladda.online/pdf-compress.html

πŸ’‘ Tip

Aim slightly under the stated cap β€” target 280 KB for a "300 KB max" form. Some portals measure in different units or reject files that land exactly on the boundary, and the visual difference between 280 and 300 KB is nothing.

⚠️ Warning

Don't compress the only copy you have. Compression of scanned pages is lossy and irreversible β€” keep the original, compress a duplicate.


❓ FAQ

Is it free? Watermark?

Free, no watermark, no signup, no file-count limit.

Why won't my PDF get any smaller?

Because it's mostly text. Text PDFs are already compact β€” there are no oversized images to shrink. Expect maybe 10–30%, not 10Γ—. See the table above.

Will text stay selectable?

For text PDFs, yes. For scanned PDFs there was never a text layer to preserve β€” the pages are images.

Is compression lossless?

Image compression is lossy by nature. That's the trade you're making to hit a KB target; the search mode exists to make that trade as small as possible.

Are my files uploaded?

No. Everything happens in your browser β€” which is why it also works offline.

I need to merge several files under one limit. Order?

Merge first, then compress the merged file to the target. Compressing the parts separately gives worse quality for the same final size.


πŸ”¬ Under the hood

  • Vanilla JavaScript, client-side PDF re-encoding; no upload endpoint exists.
  • Target mode is an iterative search over quality and image resolution, not a single fixed pass.
  • Text and vector content are preserved where present; raster pages are re-encoded.
  • Offline-capable once loaded.

Originally published on ToolAdda, where Compress PDF runs free in your browser β€” nothing is uploaded, nothing leaves your device.

Top comments (0)