Image compressor
Tell it the number of kilobytes you need and it works backwards to get there. Nothing is uploaded — the compression runs on your own device.
- 0 uploads
- No limits
- No signup
- Works offline
The problem this solves
Somewhere between the passport office and the university admissions portal, a convention took hold: upload forms specify photo sizes in kilobytes. “Photograph must be in JPEG format and must not exceed 50 KB.” No guidance on how, just the number.
Most image tools give you a quality slider from 1 to 100 and leave you to guess. You export at 70, check the file size, it is 84 KB, you try 60, now it is 47 KB but visibly mushy, and you repeat until patience runs out.
This tool inverts the problem. You give it the number; it finds the quality setting.
How the search works
The compressor treats the encoder as a black box and searches its input space:
- Encode at the highest quality in range. If that already fits your budget, stop — you get the best possible result.
- Encode at the lowest acceptable quality. If that still overshoots, the target is not reachable at this resolution, so scale the image down one step and start again.
- Otherwise, binary-search between the two bounds. Every probe is a real encode, so every size reported is real. The search halts once a result lands within 5% under the target.
Typically this takes six to nine encodes and finishes in well under a second for a phone photo on a laptop. The important detail is the ordering in step 2: resolution is preserved until it cannot be. A 1080-pixel-wide image at quality 45 almost always looks better than a 540-pixel-wide image at quality 90, so the search only sacrifices pixels once quality has nothing left to give.
Choosing a target
| Target | Realistic for | Notes |
|---|---|---|
| 20 KB | ID photos, thumbnails | expect visible artefacts on anything detailed |
| 50 KB | passport and visa form photos | the most common requirement worldwide |
| 100 KB | document scans, ID cards | comfortable for most portraits |
| 200 KB | general form uploads | usually indistinguishable from the original |
| 500 KB | email attachments, web pages | effectively lossless to the eye |
If a form gives you a range — “between 20 KB and 50 KB” — aim for the top of it. Some validators also enforce a minimum size, on the theory that a very small file means a very low-resolution photo.
Compression is not resizing
These get confused constantly, and the distinction matters:
- Compression keeps the pixel dimensions and stores each pixel less precisely. A 3000×4000 photo stays 3000×4000.
- Resizing changes the pixel dimensions. A 3000×4000 photo becomes 750×1000.
For a byte budget, compression is usually the better lever, because screen and print quality depend heavily on resolution. But if a form specifies both a size in KB and dimensions in pixels — which passport photo requirements almost always do — you want the resizer first, or the dedicated passport photo maker, which handles both at once.
What it runs on
JPEG encoding uses MozJPEG, PNG optimisation uses OxiPNG, and WebP uses Google’s own
libwebp — all compiled to WebAssembly and running in a background thread in your browser. These
are the same encoders that power Squoosh, and they consistently beat the browser’s built-in
canvas.toBlob() at the same quality setting, often by 15–20% in file size.
None of them make a network request. You can confirm this in the Network tab of your browser’s
developer tools while a batch is running: the counter in the header, which reads
↑ 0 B uploaded, is measuring the same thing.
How it works
- 01Add your imagesDrop them anywhere on the page, click to browse, or paste a screenshot with Ctrl/Cmd+V. Batches are fine.
- 02Pick a target size, or a qualityType a number like 50 for “50 KB”, or use a preset chip. If you would rather steer by quality, switch modes.
- 03Let the search runThe encoder is run repeatedly with different quality settings, binary-searching for the highest quality that still fits your budget. Resolution is only reduced if the target is unreachable any other way.
- 04Check the comparison and downloadDrag the before/after slider to see exactly what the compression cost you, then save the file or the whole batch as a zip.