How to Compress a JPEG to an Exact Size (200 KB, 500 KB, 1 MB)
Upload forms, email servers and government portals all cap file size. Here is how to hit an exact target in KB instead of guessing at a quality slider — and what to do when the target cannot be reached.
Sooner or later a form tells you the file must be under 200 KB. Or the email server bounces an attachment at 10 MB. Or a job portal refuses anything above 1 MB.
The usual advice is "lower the quality slider until it fits". That works by accident, and it is the wrong way round: you are guessing at an input to control an output, and you have no idea how much quality you threw away to get there.
Why the quality slider cannot target a size
JPEG quality is not a percentage and not a size. It is an index into a table of quantization steps defined in 1992, and its relationship to file size is neither linear nor predictable from one image to the next.
Two photos at quality 80 can differ by a factor of three in file size. A detailed landscape at quality 80 can be larger than a portrait at quality 92. So "set quality to 70" is not a recipe — it is a coin flip that happens to work sometimes.
Target size is a search, not a setting
Hitting an exact size means solving for quality, not setting it.
The honest way to do that is a bisection: try a quality, measure the result, and use that to narrow the range — repeat until you find the highest quality whose output still fits under your limit. Then confirm that one step higher would exceed it. That last check matters, because it is what separates "fits" from "fits with room to spare that we gave away for nothing".
Doing it in this tool
Drop your JPEG in, then:
1. Choose Target file size under Mode. 2. Type the limit in the Target box. The unit is KB, and it accepts 5 to 20000. 3. Leave Keep original color sampling ticked. 4. Press Compress.
You get the largest quality that still fits, and the result line tells you what it settled on. If the file was already under your target, it says so and leaves it alone rather than re-encoding it — re-encoding an already-compressed file at a higher quality makes it bigger while looking no better.
When the target cannot be reached
Sometimes no quality setting can hit the number. A 6000-pixel-wide photo at quality 5 is still large, and quality 5 looks terrible anyway.
In that case the tool shrinks the image instead. This is usually what you actually wanted: file size is dominated by pixel count, not by how hard you squeeze. Halving the width reduces the pixel count to a quarter, and a sharp 1200-pixel-wide image beats a mushy 6000-pixel-wide one on every form that exists.
If you would rather keep the dimensions, you can still get there — but you will be trading visible quality for bytes, and the tool will tell you it could not reach the target rather than pretending it did.
What to expect at common targets
These are rough, and depend heavily on how much detail is in the photo:
- 200 KB — comfortable for a 1200–1600 px photo at quality 80–85. Typical for ID photos, visa forms and job portals.
- 500 KB — fine for a 2000 px photo at quality 85. Most "attach a photo" fields are happy here.
- 1 MB — allows a 3000–4000 px photo at quality 85–90, or a large image at quality 80.
- Under 50 KB — you are in thumbnail territory; expect to resize.
Two mistakes worth avoiding
Do not compress twice. Save the original. If you compress an already-compressed file, the encoder spends bits describing the artifacts of the previous compression, so the file can grow while looking worse. Always go back to the original and compress once, to the size you need.
Do not let a tool halve your colour. Many online compressors quietly convert every file to 4:2:0 chroma subsampling. Once the colour channels are averaged, no quality setting can bring them back — see what chroma subsampling is for why that matters on reds, thin coloured text and anything synthetic. This tool reads the sampling out of your file and keeps it.
Everything here runs in your browser. Your file is never uploaded — which matters more than usual when the document is a passport scan or a signed contract.