Compress to exact KB

Hit a hard limit like 20KB, 50KB or 200KB on the first try.

Target size

Quality is searched automatically until the file fits under the limit.

Save as

PNG isn't offered here — it has no quality setting, so it can't be searched down to a target size.

How to use Compress to exact KB

  1. Drop your JPG, PNG or WebP files onto the upload area.
  2. Pick a target size, such as 20 KB, 50 KB or 100 KB, or type a custom size in KB.
  3. Choose JPG or WebP under Save as.
  4. Click Compress. The tool searches for the highest quality that fits under your limit.
  5. Download each file, or click Download all for a zip.

A lot of upload forms — exam portals, government sites, visa applications — reject a photo for being over a hard byte limit and leave you guessing at what quality setting gets under it. This tool skips the guessing: pick a target size and it searches for the highest quality that still fits, automatically.

The search is a binary search over the quality setting, encoding the image repeatedly until it converges on a value just under your limit. Eight passes gets within a few hundred bytes for most images, fast enough to feel instant.

Everything runs in your browser — nothing is uploaded, so there's no size limit on the file going in. Drop in a batch, set your target once, and compress them all to the same limit together.

Questions

What if my image can't get small enough?

Extremely small targets on a large or highly detailed photo may not be reachable even at the lowest usable quality. The tool returns the smallest result it managed to reach rather than failing outright — check the output size against your limit.

Why isn't PNG offered as an output format?

PNG has no quality setting to search over — it's always encoded losslessly, so there's no dial to turn to hit a byte target. JPG and WebP both compress in a way that can be tuned, which is what this tool needs.

Does it try every quality value one by one?

No — it uses a binary search, encoding at most eight times to converge on the highest quality that fits, rather than checking every possible value.

Can I compress many files to the same target at once?

Yes — drop in as many images as you like and they'll all be searched down to the same limit in one go.

Are my images uploaded anywhere?

No. The search and every encoding attempt happen entirely in your browser — the files never leave your device.

Guides

Related tools