toolImage editingfree
Compress Image to an Exact File Size
Hit a hard KB limit — for upload forms that reject big files.
Drop an image here, or
Nothing is uploaded — the file stays in your browser.
Runs entirely in your browser. Nothing you paste is uploaded, logged, or stored.
How to use it
- Choose a JPG, PNG, or WebP image.
- Set the maximum file size in KB, or pick a preset.
- Choose JPEG or WebP output.
- Compress and download the result.
Why a target size, not a quality slider
Upload forms reject files by size, not by quality percentage. Guessing at a quality slider until the file happens to fit wastes time, so this tool inverts the problem: you state the ceiling and it finds the best image that stays under it.
How the search works
- If the file already fits and the format matches, it's returned untouched.
- Otherwise the tool binary-searches encoder quality between 8% and 95%, ten times, for the largest blob that still fits.
- If even the lowest quality overshoots, dimensions shrink by 18% and the search repeats — up to ten passes, never below 96px.
That ordering matters: quality is sacrificed before resolution, because a slightly noisier full-size image usually beats a clean thumbnail.
FAQ
- Are my images uploaded to a server?
- No. Every tool here decodes and re-encodes your file using your browser's own Canvas APIs. The image never leaves your device, which is also why it works offline once the page is loaded.
- Why is WebP often smaller than JPEG?
- WebP uses a more modern compression scheme and typically lands 25-35% smaller at equivalent visual quality. Every current browser supports it, so prefer it unless you need to hand the file to legacy software.
- It says it can't reach my target — why?
- Some targets are impossible without destroying the image, for example a 20 MP photo under 10 KB. Either raise the limit or allow dimension reduction so the tool can shrink the image as well as its quality.