Compress an image to an exact size

Forms rarely ask for a smaller photo. They ask for one under 100 KB, or between 20 KB and 50 KB. Give this the limit and it finds the best quality that fits, without you guessing at a slider.

Getting the tool ready…
Next?Compress imageResize imagePassport photo
Your file never leaves this device. How that works

How to compress an image to an exact file size

STEP 1

Add your photo

Drop it above or pick it from your files. Add several if you have a set to get through, they are all handled on your own device.

STEP 2

Type the limit

Choose one of the usual limits, or type the exact number of kilobytes the form asks for. If it also demands a minimum size, tick the box and set that too.

STEP 3

Save it

You get the finished size and the pixel dimensions. If the limit turned out to be impossible, it says so rather than handing you a ruined picture.

Why a quality slider cannot answer this

There is no fixed relationship between a quality setting and a file size. The same setting that takes a plain headshot to 60 KB will leave a detailed street scene at 400 KB, because compression works by discarding detail and one of those pictures has far more detail to discard.

So guessing at a slider means exporting, checking the size, adjusting and exporting again. This does that loop for you, encoding the image several times and narrowing in on the highest quality that still fits. It usually settles in well under a second.

When the limit is very small, quality alone eventually stops helping and starts producing a smeared mess. At that point fewer pixels beat lower quality, so the picture is scaled down as well and the result tells you that it was. If even that cannot reach the number, you are told plainly instead of being given something unusable.

Questions

Is my file uploaded anywhere?

No. The work happens inside this tab, on your own machine. Open your browser's network tab while you use the tool, there is no request carrying your file.

Is there a file size limit?

None set by us. Very large files are limited only by your device's memory, and we warn you before that becomes a problem.

Do I need an account?

No, and there is no daily limit either. There is nothing to sign up for.

Why is my result a little under the limit rather than exactly on it?

Because encoders cannot be told to produce an exact byte count. It finds the highest quality that lands under your limit, which is what a form is checking for.

Can I use PNG?

Not for a size target. PNG compression is lossless, so there is no quality to trade away. Choose JPG, which is what most forms want anyway.

What if the form wants a minimum size too?

Tick the second box and set the floor. It will stop as soon as it lands inside the range instead of squeezing the file as small as it can.

Next, you might want to

Compress imageJPG, PNG and WebP, one or a hundredResize imageExact pixels, percentages or presetsPassport photoCorrect size for any countryConvert formatJPG, PNG and WebP, both directions