How to Compress an Image to an Exact Size
The form says 200KB. It does not say 78% quality. So why does every tool ask you for a percentage?
You are filling in a visa application, an exam registration or a job portal. It wants a photograph under 200KB. Yours is 4MB. So you open a compressor, drag a slider to some number, export, check the file size, find it is 340KB, drag again, export again.
That loop exists because the tool is asking the wrong question.
Why quality percentages cannot tell you the size
A JPEG quality setting is not a size dial. It controls how aggressively detail is discarded, and how many bytes that produces depends entirely on what the picture contains.
Photograph a plain wall and 90% quality might give you 80KB. Photograph a forest — thousands of leaves, no flat areas anywhere — and the same 90% might give you 3MB. Same setting, same camera, forty times the file. No percentage can be translated into kilobytes without knowing the image, which is why the guess-and-check loop is unavoidable when a slider is all you have.
Turning the question round
The reliable method is to search rather than guess. Encode the image, measure the result, and use that measurement to pick the next attempt — narrowing the range each time until you have the highest quality that still fits.
Seven or eight attempts land within a percent or two of any target. That is what Compress to a target size does: you type 200KB and it returns a file just under 200KB, at the best quality that budget allows. In testing, a 200KB target produced 196KB and a 100KB target produced 98.8KB.
When the photo will not go that small
Sometimes no quality setting is low enough. A 4000-pixel-wide photograph cannot become 50KB, because there are simply too many pixels to describe in that many bytes. Push the quality down far enough and you get a blocky mess that still misses the target.
At that point the answer is fewer pixels, not worse ones. And the difference is dramatic — here is the same 15KB budget spent two ways on the same photograph:
- Keep the dimensions: 1280 × 960 at 9% quality. Technically fits. Looks destroyed.
- Shrink first: 419 × 315 at 72% quality. Same 15KB, a perfectly clean small photograph.
Almost nobody wants the first one. A good tool should shrink the image and tell you it did so — which is the behaviour to look for, because silently returning either result is unhelpful.
Typical limits and what they mean
- 20–50KB — Older government portals. Expect to end up around 600 pixels wide.
- 100–300KB — Visa applications and ID photos. Comfortable for a 1000-pixel image.
- 240KB — The US State Department's cap for online passport photos.
- 1–2MB — Job applications and general web forms. Rarely a struggle.
- 5MB and up — Marketplace listings. Only very large photographs hit these.
Getting more quality into the same budget
Two things genuinely help before you compress:
Resize deliberately rather than letting the tool do it. If you know the photo will be displayed at 800 pixels, resize to 800 first — see resize before you compress. You get to choose the trade-off instead of accepting whatever the search settles on.
Use WebP if the form accepts it. It fits noticeably more detail into the same bytes than JPEG. Most portals still want JPEG, so check first — JPEG vs PNG vs WebP covers the differences.
Screenshots are a different problem
Everything above assumes a photograph. A screenshot of text is flat colour and sharp edges, which is what JPEG handles worst — compressing one smears the text and often produces a larger file than the PNG you started with. Keep screenshots as PNG, or convert to WebP, and reduce the dimensions if you need them smaller.
Frequently asked questions
Will compressing to a target ever go over the limit?
It should not. A correct search only keeps candidates at or under the number you gave it, so the file you download always fits.
Does compressing remove my EXIF data?
Yes, as a side effect — compression redraws the image and metadata does not survive. If that is the actual goal, Remove EXIF is more direct.
Can I compress the same file twice to get it smaller?
You can, and you should not. Each lossy pass discards more detail permanently. Go back to the original and compress once at the right target.
Related guides and tools
- Compress to a target size — the tool
- Reducing image file size — resize first, then compress
- Passport photo sizes — when the size cap is one of three constraints
Summary
A quality percentage cannot be converted into kilobytes, so state the size you need and let the tool search for the quality. If the photograph cannot reach the target at any quality, the pixel count is the problem — shrink it and the same budget buys a far better picture.
