Compress Image to Exact Size
Hit a precise KB or MB target — pick a preset like 20KB or 200KB, or enter a custom size. Runs entirely in your browser.
Compress to a target size
Upload an image, choose a target size, then download a JPG that fits it.
Result
How to use this tool
- Drag and drop an image into the box above, or click to browse and select one.
- Pick a quick preset (e.g. 100 KB) or enter a custom target size and unit.
- Press Compress to target — the tool searches for the best quality that still fits your target.
- Click Download image to save the result, which will be at or just under your target size.
FAQ
Frequently asked questions
Is my image uploaded anywhere?
No. The target-size search runs locally in your browser using the Canvas API — nothing is uploaded.
How does hitting an exact size work?
The tool repeatedly re-encodes your image as JPEG at different quality levels (a binary search) until it finds the highest quality that still fits under your target size. If quality alone can't reach the target, it also slightly reduces the image dimensions and tries again.
Why does the output become a JPG even if I uploaded a PNG?
Precise size control depends on JPEG's adjustable quality setting — PNG is lossless and can't be fine-tuned the same way. If your image needs transparency, exact-size targeting isn't suitable since it always exports as JPEG.
Can I get exactly 20KB, or just close to it?
The tool aims to land at or just under your target size — for common presets like 20KB or 100KB it's typically within a few percent, close enough for form uploads and portals with a strict size limit.
