Compress an image to an exact size

Your file is processed in this browser tab. It is not sent to our servers.

How it works

Most image compressors give you a quality slider and leave you guessing which value lands under the size you need. This tool works the other way round: you name the size (say “under 100 KB”) and it searches for the highest quality that still fits.

When you pick a photo, it is decoded in your browser and re-encoded with the HTML Canvas at different quality levels. A binary search hones in on the largest output that stays under your budget; if quality alone cannot get there, it reduces the dimensions too. Nothing is uploaded: the work happens on your own device.

Re-encoding also drops the photo’s embedded metadata (such as GPS location), so a compressed copy is a little more private as well as smaller.

How to use it

  1. 1 Choose your image, JPEG, PNG, WebP or an iPhone HEIC photo.
  2. 2 Pick a target size, for example “Under 100 KB”.
  3. 3 Press Compress and wait a moment while it finds the best quality that fits.
  4. 4 Download the compressed image.

Good to know

  • Inputs: JPEG, PNG, WebP and iPhone HEIC. The output is a JPEG.
  • Compression strips the photo’s metadata (like GPS), a small privacy bonus.
  • If a target is too small for the image, dimensions are reduced as well as quality.
  • Nothing is uploaded: the whole process runs in your browser.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later · full speed from 105
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Why "quality 80" is not a file size

Every image compressor offers a quality slider, and the number on it tells you almost nothing about the file you will get. JPEG quality is not a ratio or a target. It selects a quantisation table, which decides how aggressively the encoder discards detail in each block of the image. How much smaller that makes the file depends entirely on what is in the picture.

A photograph of a clear sky compresses enormously, because neighbouring pixels are nearly identical and the encoder can describe large areas cheaply. A photograph of gravel, foliage or a crowd does not, because there is genuine detail in every block and quantisation has less to throw away. The same quality 80 can produce a 90 KB file from one and a 900 KB file from the other. This is why "compress to quality 80" is a setting and "get this under 100 KB" is a job, and why asking a person to guess the first in order to achieve the second is a bad interface.

So this tool does not ask. You state the size you need, and it searches for the quality that lands under it. Encode, measure the real byte count, adjust, repeat. It is a bisection over the quality axis: each attempt tells the search which half of the remaining range to keep, and a handful of encodes converges on the highest quality that still fits. The number of attempts is bounded, and the result is the actual encoded file rather than an estimate, because the only reliable way to know how big a JPEG is is to produce it.

Two things fall out of that design. The first is that resolution is part of the answer. Below a certain size, no quality setting will fit a 12 megapixel photograph into 20 KB while leaving it recognisable, and the honest move is to reduce the dimensions rather than destroy the detail. The second is that the search runs on your device. Every one of those trial encodes happens in your browser, which is why the file never needs to be uploaded, and why the tool can afford to try repeatedly: nobody is paying for the CPU by the second.

If you are choosing a format rather than a size: WebP typically lands 25 to 35 percent below JPEG at visually equivalent quality, and AVIF lower still, but both are slower to encode and JPEG remains the format that every government portal and recruitment site will definitely accept. When a form says "JPEG under 100 KB", it means it.

Frequently asked questions

How do I compress an image to under 100 KB?

Choose the “Under 100 KB” target, pick your image, and press Compress. The tool finds the best-looking version that fits and gives you a download.

Will compressing reduce the quality?

Only as much as needed to reach your target. If the target is generous for the image, the quality stays high; tighter targets trade off more detail.

Which image formats can I compress?

JPEG, PNG and WebP, plus iPhone HEIC/HEIF photos. The output is a JPEG.

Are my images uploaded to a server?

No. The image is decoded and compressed inside your browser tab and is never sent to us.

Why is a very small image not getting smaller?

Tiny images are already efficient, so re-encoding cannot shrink them further. You may see roughly the same size.

Related tools

How this tool was built — a step-by-step account of the engine, the code and what went wrong.

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.