Compress an image to an exact file size
Portals and application forms often refuse anything over a fixed size. Type the limit in kilobytes and the right quality is found for you — locally, without uploading the file.
click to choose · or paste from the clipboard
Nothing here is uploaded. Disconnect from the internet and the page keeps working.
Why this is fiddly by hand
There is no formula that turns "quality 74" into "83 KB". The relationship depends on the picture itself — a flat studio background compresses to a fraction of what a detailed street scene does at identical settings. That is why compressing by hand means exporting, checking the size, nudging the slider, exporting again.
This page does that loop for you. It encodes the image several times, each time narrowing the range, until it finds the highest quality that still lands under your limit. Seven passes are usually enough to get within about one percent of the ceiling. Everything happens in your browser, so those repeated encodes cost nothing but a second or two of your own processor.
What happens when the target is impossible
Some targets cannot be met by quality alone. A 6000-pixel-wide photograph will not fit in 20 KB no matter how far the quality drops — long before that it stops looking like a photograph.
When quality alone is not enough, the tool starts reducing the pixel dimensions, in steps, because a smaller sharp image beats a full-size smeared one. And if even that fails, it says so plainly on the row rather than handing you a file that quietly misses the limit you asked for.
Common limits people are given
| Where | Typical limit | Suggested format |
|---|---|---|
| Public-sector application forms | 100–500 KB | JPEG |
| Passport or ID photo upload | 50–300 KB | JPEG |
| Job application portals | 1–2 MB | JPEG |
| Forum avatars and signatures | 50–200 KB | JPEG or WebP |
| Email attachment kept polite | 500 KB – 1 MB | JPEG |
Choose JPEG when something official is going to receive the file: it is accepted everywhere. WebP reaches the same target at visibly better quality, but only pick it if you know the receiving system takes it.
Questions
+ Will the result be exactly the size I typed?
It will be at or under it, never over — which is what a limit means. Landing exactly on the number is not possible, because encoders do not offer that fine a control.
+ Why does it take longer than the other tools?
Because it encodes the image up to seven times to find the right quality, instead of once. On a big photo that is a couple of seconds rather than a fraction of one.
+ Can I do a whole batch against one target?
Yes. Every image is searched independently, so each one lands under the limit on its own terms rather than all sharing one quality setting.
+ Why can I not pick PNG here?
PNG is lossless — it has no quality dial to search. Hitting a byte target with PNG would mean shrinking the image, which is a different operation with a different tool.
+ Is the file uploaded to find the right size?
No. Every one of those encoding passes happens in your browser. Nothing is sent anywhere, which is also why there is no queue and no limit on how many you run.