Compress an image to an exact file size
Set a target like 50 KB, 100 KB or 1 MB. The optimizer finds the highest quality that stays at or under your limit, and reports exactly what it achieved.
Examples: 20 KB, 50 KB, 200 KB, 1 MB. The result stays at or under this limit.
Last reviewed . Runs locally — your images never leave your device.
How it works
- Drop your image and type the target size (for example 50 KB or 0.5 MB).
- The tool runs a quality search entirely on your device and picks the best result that fits.
- If the target cannot be reached without visibly damaging the image, you are told exactly that — with the option to allow reducing pixel dimensions.
- Download the result with a clear before/after report.
Supported formats
JPEG, PNG, WebP, AVIF and GIF (first frame).
Best with files up to 50 MB. Hard safety limit 200 MB.
Privacy
Everything happens in your browser: the image is decoded, transformed and encoded locally. Nothing is uploaded, and no filename, pixel data or metadata is sent anywhere. Read more on the privacy page.
Technical methodology
- Formats with a quality parameter (JPEG, WebP, AVIF) are optimized with a bounded binary search between quality 0.05 and 0.95, capped at 14 encode passes. The search keeps the highest quality whose encoded size stays at or under your target.
- The search stops early once the result lands within the closer of 2% of the target or 1 KB, so typical runs finish in a few passes.
- If even the lowest quality stays above the target, the tool reports the achievable floor. Dimension reduction is applied only when you explicitly enable it, using a descending scale ladder (90% → 30%); the chosen scale is shown in the report.
- PNG (lossless) cannot be quality-tuned. Targets that require shrinking a PNG are handled through optional dimension reduction, or by converting to JPEG/WebP when you allow it.
- All processing happens in your browser. No image data, filename or pixel content is transmitted.
Known limitations
- No tool can guarantee a mathematically exact size: encoders quantize output, so results land at or just under the target — never at "exactly 50.000 KB".
- Extremely small targets (for example 10 KB for a 12-megapixel photo) can only be met with visible quality loss or smaller dimensions. The tool reports which one is required instead of silently degrading your image.
- Animated GIF/WebP files are processed as their first frame.
Frequently asked questions
Does this tool upload my image?
No. The image is decoded, re-encoded and optimized entirely inside your browser tab. Nothing is uploaded, and the page works offline once loaded.
Can you make the file exactly 50 KB?
No honest tool can hit an exact byte count, because image encoders quantize their output. This tool maximizes quality subject to the limit — so you get the best-looking image that is at or under 50 KB, typically within a few percent of the target.
What happens if my target is impossible at full dimensions?
The tool shows the smallest achievable size at your current pixel dimensions. You then choose: accept the floor result, or explicitly allow dimension reduction and let the optimizer try again.
Will you ever shrink my image without asking?
Never. Dimension reduction is off by default and only applies when you enable it for that run.
Which formats work best for very small targets?
JPEG and WebP usually reach small targets with the most acceptable quality. PNG is lossless and often cannot reach aggressive targets without reducing dimensions; the tool will tell you when that is the case.