What does compressing to a target size mean?
Compressing to a target size means working backwards: instead of choosing a quality setting and seeing what size comes out, you state the size a form or a profile will accept and the tool searches for the quality and dimensions that produce a file that fits. It is the same set of decisions — quality, dimensions, format — but the search does the guessing rather than leaving it to a sequence of attempts.
Two levers are available and they behave differently. Quality removes detail from the encoding and hits a floor: a JPEG at 20 is the smallest that format will make of a given image, and pushing further produces artefacts long before it produces much saving. Dimensions have no such floor, because size follows pixel count. Halving the width and height leaves a quarter of the pixels and roughly a quarter of the bytes. The tool tries quality first, at full size, and only starts dropping dimensions when the quality floor is still above the target.
The output includes the honest verdict as well as the file. Some targets are simply not reachable — a detailed photograph cannot be 10 KB at any usable quality — and a tool that reports that is more useful than one that returns a 60 KB file and calls it 10 KB.
How to reduce an image to an exact size
- Choose the image. The original is used as the source, so compress from the file you have rather than from something already compressed.
- Type the target in kilobytes — 20, 50, 100, 200, whatever the form asks for. 1 MB is 1024 KB if you need it.
- Pick JPG for the forms that expect it, or WebP if you are publishing to the web and want the same quality at a smaller size.
- Press Compress to the target. The search runs in the page and takes a moment, since it encodes the image several times.
- Read the verdict: the size achieved, the quality kept and the dimensions. A green panel means it fits; amber means the floor was above your target.
- Download the compressed file. If it did not fit and you cannot lower the target, try cropping the frame rather than compressing harder.
Compress Image to a Target Size limits and rules
| Item | Limit |
|---|---|
| Formats out | JPG and WebP, the two that support a quality setting |
| Target | Any size in KB; below about 10 KB is unreachable for a photograph of any detail |
| Search | About eight encodes per scale, at up to eight scales, entirely in the page |
| Levers used | Quality first at full size, then a scale down in 10 percent steps |
| Quality floor | 0.2, below which artefacts dominate and the saving flattens |
| Transparency | None: JPG and lossy WebP output, with transparent pixels filled white |
| Input size | Up to 25 MB |
| Honest failure | Reports the smallest achievable size when the target cannot be met |
When to use it
- Hitting the upload limit on a government, visa or job application form that refuses anything above a stated size.
- Producing a profile picture for a platform that caps avatars at a few hundred kilobytes.
- Getting a passport or ID photograph under a size that is checked rather than merely recommended.
- Preparing an image for an email attachment where the mailbox rejects large files.
- Meeting a stated maximum for an advertising or marketplace listing, where the upload fails silently above it.
Is it private?
The image is never uploaded. It is drawn into a canvas at each attempted quality and size, encoded, measured, and thrown away when it does not fit — all inside your browser. Nothing is stored, so an identity document or a photograph you would rather not hand over stays on your machine.
Frequently asked questions
Because file size depends on the content, not just the settings. A photograph of foliage has fine detail in every pixel and needs a great deal of data to look right; a portrait against a plain wall has large flat areas that compress almost to nothing. The same quality of 85 can therefore produce a 90 KB file from one and a 400 KB file from the other. That is exactly why a target-size tool has to search per image rather than apply a fixed recipe.
Dimensions, if you have a choice. Removing pixels changes what the image is rather than how well it is stored, and a smaller image at a reasonable quality usually looks better than a full-size one at a brutal quality, because JPEG artefacts accumulate around every edge. The exception is an image that will be viewed large, where the resolution is the point — in that case accept a lower target or convert to a more efficient format rather than shrinking.
No, and it is worth knowing before you try. Ten kilobytes is roughly a thumbnail's worth of data, so it is achievable for a small image with simple content and not achievable for a detailed photograph at any usable quality. The tool will report the smallest size it can reach, and if that is above your target, the honest fixes are to crop the image, to reduce the dimensions yourself, or to accept that the requirement cannot be met with the picture you have.
Yes. Each lossy pass re-encodes the artefacts of the previous one, treating them as image detail and preserving some of them, so a second compression of an already compressed file tends to be visibly worse for the same size. It is why the search here works from the image you chose and encodes repeatedly without saving intermediates. If you have the original, always start from that rather than from a file that has already been through a compressor or a messaging app.
Because the original was already efficiently encoded, and re-encoding at a high quality adds a generation of overhead. A file that came out of a phone's camera at 2 MB in HEIC, or one already saved as WebP at quality 80, has very little left to give — a target near its current size will simply be met or slightly exceeded. In that case the useful move is to reduce the dimensions rather than to lower the quality, and the tool will do that on its own if the quality search cannot fit.
It is dropped, since the canvas API returns pixels and nothing else. For a form that checks a photograph of an identity document, that is normally what you want: no camera model, no capture date and no GPS coordinates travelling with the file. It does mean the orientation tag goes too, so an image that relied on EXIF to say it was rotated may need rotating in the preview before you download it.
Related tools
Written and maintained by Md. Nur Hossain Repon.