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:

  1. Encode at the highest quality in range. If that already fits your budget, stop — you get the best possible result.
  2. 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.
  3. 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

  1. 01Add your imagesDrop them anywhere on the page, click to browse, or paste a screenshot with Ctrl/Cmd+V. Batches are fine.
  2. 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.
  3. 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.
  4. 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.

Questions people actually ask

How accurate is the target size?
The result lands within about 5% below your target, and never above it. Overshooting would defeat the purpose — if a form says “maximum 100 KB”, a 101 KB file is rejected. The search stops as soon as it finds a result inside that window.
Why do I need an exact size at all?
Because a great many official forms specify one. Visa portals, university applications, government job boards, banking KYC uploads and exam registrations routinely cap photos at 20, 50, 100 or 200 KB. Most of them reject anything larger without saying why.
How does it hit the number?
It binary-searches the JPEG or WebP quality parameter. Each attempt is a real encode, so the reported size is the actual file size and not an estimate. If even the lowest acceptable quality is still too large, the image is scaled down a step and the search restarts — keeping pixels is preferred over keeping quality, until it is no longer possible.
Will it wreck the picture?
That depends entirely on how aggressive your target is. Squeezing a 12 MP photo into 20 KB will look rough, and no tool on earth can change that. The before/after slider is there so you can judge for yourself before downloading rather than after.
Is there a limit on file size or how many I can do?
No. There is no upload, so there is no bandwidth bill and nothing to ration. The practical ceiling is your device’s memory.
Does compressing remove EXIF and GPS data?
Yes. Because the file is re-encoded from raw pixels, metadata is dropped unless you explicitly ask to keep it. For most people uploading a photo to a form, that is exactly what you want.
Can it compress PNG without losing quality?
Yes — choose PNG as the output and it is optimised losslessly with OxiPNG, which typically saves 10–25% with pixel-identical output. Note that lossless optimisation cannot guarantee an exact byte target; for that, JPG or WebP is the right choice.
Which format gives the smallest file?
For photographs, WebP is usually 25–35% smaller than JPEG at the same visual quality, and AVIF smaller still. The catch is compatibility: if you are uploading to an official form, use JPG. If it is for your own website, use WebP.