Image Compressor: Compress to a Target File Size
Enter the size you need, for example 100 KB, and the tool searches for the JPEG or WebP quality that gives the largest file still at or under it. Width and height stay the same; only the compression changes.
Drop your image here or click to select
Supports JPG, PNG, and WebP - up to 50 MB
Runs in your browser: your files and text are not uploaded. Free, no account needed.
Last updated: · Reviewed by the QuickTooly Team
Image Compression Guide
How the target-size search works
Your image is drawn onto a canvas once. The tool then runs a binary search over quality values from 1 to 100. It encodes at the middle value and compares the file size with your target. If the file is too big, the search continues in the lower half; if it is too small, in the upper half. Halving 100 values needs at most seven encodes.
Every attempt is remembered. The largest one that is at or under the target wins, since it has the highest quality that still fits, and it is marked "Target achieved". A result above the target is never chosen when one under it exists. If no attempt fits, you get the smallest one with "Best possible" and the size reached.
When the result is over your limit
"Target achieved" means the file is at or under the target as this tool counts it. KB here means 1,024 bytes, so 100 KB is 102,400 bytes. Some sites count a kilobyte as 1,000 bytes, so for a strict 100 KB limit on such a site, aim a few percent low, for example 97 KB.
If even quality 1 is above the target, the tool cannot get there, because it never reduces the pixel dimensions. Make the image smaller first with the Image Resizer, then compress it.
If your original is already at or under the target, it is returned unchanged, with its own name and format, and the result says so. Re-encoding it would only lose quality.
JPG or WebP output
- JPG (default): accepted almost everywhere. Transparent areas of a PNG are filled with white.
- WebP: keeps transparency and often holds more detail at the same size, but check that the site you upload to accepts .webp files.
- No PNG output: PNG is lossless, so it has no quality value to search over.
- Input: one JPG, PNG or WebP file up to 50 MB. Presets cover 30, 50, 100, 200 and 500 KB and 1 MB, and the target starts at 100 KB. EXIF data is not carried over.
Frequently Asked Questions
Why does a site reject a file that says "Target achieved"?
The file is at or under the target counted in units of 1,024 bytes. Some sites count a kilobyte as 1,000 bytes, so their limit is slightly lower. Enter a target a few percent below the real limit.
Why does it say "Best possible" instead of "Target achieved"?
Even the lowest quality could not get under the target at the current pixel dimensions. Resize the image to fewer pixels and compress again.
What happens if my image is already under the target?
Nothing is re-encoded. The original file is returned unchanged and the result says it was already under the target.
Related image tools
- Image Resizer - to cut the pixel dimensions when quality alone cannot reach the target
- Image Converter - to compress a whole batch at one fixed quality instead of a target size
- HEIC to JPG Converter - to turn iPhone photos into JPG first, since this page accepts only JPG, PNG and WebP