Skip to content

Compress an image to an exact size

Give it the number the form asks for, and the pixel size if there is one. Nothing is uploaded.

Your photo is resized here, inside this page. It is never uploaded.

By using this site you confirm you have the right to download the file you request.

A form can reject two different things

File size and dimensions are separate measurements, and an upload form may police either or both. A 200 × 200 photo can weigh 400 KB; a 4000 × 3000 one can weigh 90 KB. "The image is too large" tells you nothing about which of the two was meant.

Which numbers you are given depends on the form in front of you, and some forms state all of it at once. The Saudi eVisa page is one documented example: one photograph, 200 by 200 pixels, and a file between 5 and 100 KB. That lower bound is not a typo — a picture squeezed hard enough to clear the ceiling stops being a usable likeness, so the form refuses it from below as well.

What the form saysWhat it is measuringWhat to change here
Maximum 100 KBBytes on diskThe target size
200 × 200 pixelsThe dimensions of the pictureWidth and height
Minimum 10 KBBytes again, from belowRaise the target, or the dimensions
JPG onlyThe file formatSave as JPEG

What a kilobyte means on an upload form

Two definitions are in use at the same time. A kilobyte is 1,000 bytes in the metric sense and 1,024 in the sense most operating systems display, so a 100 KB limit is either 100,000 bytes or 102,400 depending on who wrote the checker — and the form never says which.

The gap is 2.4 per cent, which is precisely the margin a file lands in when it is aimed at the ceiling. This page aims at the smaller of the two, so the result passes a form that counts either way. It is also why the size reported here can read a little under what your file manager shows.

How it reaches the number

JPEG quality is not a size dial. The same quality setting produces a small file from a plain studio background and a large one from grass, hair or a crowd, because what compresses is detail. No formula turns "100 KB" into a quality figure, so the only honest way to hit a number is to encode and measure.

That is what happens here: encode, compare against your number, and halve the remaining range each round. Eight rounds land within about a quarter of a per cent of the best quality that still fits. If even the lowest quality is too big, the picture simply has more pixels than the number allows, and the dimensions come down a step at a time.

With one exception. If you set an exact width and height, the dimensions are what the form demanded, so they are not touched: the tool stops at the smallest file those dimensions can produce and tells you it did, rather than quietly handing back a photo too small to be accepted.

A phone photo is usually wrong in two ways

It is too heavy. A current phone camera writes a twelve-megapixel picture of three to five megabytes, and a form asking for 100 KB wants about a fortieth of that. Reducing the dimensions does most of the work before quality is touched at all — a 4000-pixel-wide photo displayed in a 200-pixel box is carrying four hundred times the pixels anyone will see.

And it may be the wrong format. iPhones save HEIC by default, and many upload forms refuse the extension before they look inside the file. The same tool reads HEIC and writes JPEG, and the HEIC page in the related links explains the rest.

What gets removed along the way

A photo from a phone carries EXIF metadata: the camera model, the exact date and time, the settings — and, if location services were on, the coordinates where it was taken. Re-encoding a picture writes a new file from the pixels alone, so none of that survives into the result.

For a form that is a quiet improvement: an identity photo has no business carrying a home address in its header. The one piece of metadata that does matter is orientation, which is read before anything else, so a photo taken sideways arrives upright rather than on its side.

Sources

Primary specifications and vendor documentation for the technical claims on this page.

Frequently asked questions

Is my photo uploaded?

No. It is read from your disk, resized inside this page and handed back. Nothing is sent to us or to anyone else, which is the point when the picture is an identity document.

Why is it still above my number?

The dimensions are the floor. If you asked for an exact width and height, the tool will not shrink them to make the file fit — allow a smaller size, or raise the target.

Does it keep the shape of the picture?

Yes, unless you ask for an exact width and height that do not match it. Then it fills the box and crops the overflow from the centre, which is what a square ID photo needs.

Will the quality drop?

At form sizes, yes, and usually not visibly. A JPEG around quality 70 is hard to tell from the original at 200 × 200. Below about 30 KB on a detailed photo it starts to show.

Can I keep PNG?

You can, but PNG has no quality setting, so a target size cannot be applied to it. For a size target, JPEG is the format that can be aimed.

What about a minimum size?

Some forms set one, to stop people submitting a photo compressed past recognition. Raise your target above the minimum, or keep the dimensions larger.

Read next