Compress an Image to a Target File Size
Processed entirely in your browser. Never uploaded to a server.
Target size
Current target: 500 KB
Drop a JPG, PNG, or WebP here or click to browse
Processed entirely in your browser. Never uploaded to a server.
- File size
- Dimensions
- Output format
- Quality used
This tool compresses a JPG, PNG, or WebP until it fits a file size you choose. Pick a target above, drop the image, and it works out the encoder settings for you instead of asking you to guess at a quality slider.
Use it when something has rejected your file for being too big: a job application portal capped at 500 KB, a forum avatar capped at 100 KB, a visa or passport photo upload, or an email attachment limit.
How it decides
First it checks whether the file already fits. If it does, you get your original bytes back with no re-encoding at all. Otherwise it binary-searches encoder quality between 10 and 95, up to 8 passes, and keeps the highest quality that still lands under the target. Only if quality 10 is still too large does it start reducing the pixel dimensions, in steps, running the quality search again at each smaller size. That order matters: dropping resolution is the more visible change, so it is the last resort, not the first move.
Formats and transparency
A JPG stays a JPG. A PNG or WebP is encoded as WebP, because PNG has no quality setting to search against. If the image contains transparent pixels, the output is WebP, which keeps the alpha channel. Transparency is never dropped by converting to JPG behind your back. The results panel always names the output format so there is no guessing.
When the target cannot be met
Some combinations are not achievable, for example a 50-megapixel photo squeezed into 20 KB at full resolution. In that case you still get a file: the smallest one the tool produced, clearly marked as over target. Raising the target or accepting a smaller pixel size is usually the fix.
Want a plain quality-based squeeze with no size target? Use Compress Image. To set exact pixel dimensions instead, use Resize Image.
Not sure whether you need a smaller file or a smaller image? Read: Compression vs Resizing.
FAQ
How does it hit an exact size limit?
What if my target is impossible?
Will my PNG stay a PNG?
Does transparency survive?
What does "1 MB" mean here?
Targeting a specific size for an email attachment? Read why the real limit isn't what it looks like.
Advertisement
Ads help keep Kit-Bin free.