Compress to Exact Size

Hit an exact file size target — automatic quality tuning in your browser

Free plan: 20 uses/day

Get unlimited daily uses and every tool with ImageTools Pro — activation is instant and no account is required.

20 of 20 free uses left today

Upgrade to Pro

Drag & drop your image here

or click to browse

.JPG · .JPEG · .PNG · .WEBP — Max file size: 20MB

Frequently Asked Questions

What exactly does 'compress to a target size' do?

It automatically searches for the highest quality that still puts your file under the target (50KB, 100KB, 200KB...). You don't touch a slider — the tool finds the sweet spot for you.

What if the image can't reach the target size?

The tool tries the lowest quality first. If even that is bigger than the target, you get the smallest possible version and a clear warning — then try WebP format or a bigger target.

JPG or WebP — which should I pick?

WebP is typically 25-35% smaller at the same quality and keeps transparency, so it reaches the target size more often. JPG is the safest for maximum compatibility.

Is this the same as the quality slider compressor?

No. The regular compressor gives you manual control. This one is fully automatic: pick a size limit (email, form, CMS, avatar...) and let it tune quality by itself.

How this tool works

Forms, email systems and websites love precise limits — 100KB here, 500KB there, 1MB for avatars. 'Compress to exact size' is the tool that lands right under those limits automatically, without you touching a single slider.

  • Pick the target file size (or type a custom one) and the output format. The engine then runs a binary search on quality: it encodes the image at different quality levels until it finds the highest one that stays under your limit.
  • Because the whole process happens on your device, your photo never leaves your browser. Original dimensions are preserved — we only tune the compression, not the resolution.

Why exact-size compression is valuable

Rejected uploads are a top reason people abandon forms: a 102KB file fails a 100KB check and the whole visit is lost. Landing just under the limit means the first attempt always works.

Targeted compression also saves bandwidth at scale — a 200KB image instead of a 2MB one loads 10x faster on mobile networks, where most of the world now browses.

Pro tip: If you must respect the limit even after a warning, switch the output to WebP — it's typically 25-35% smaller than JPEG at the same quality.

Formats and limits

InputJPG, JPEG, PNG, WebP
OutputJPG or WebP
Target sizeFrom 1 KB to 20 000 KB (20 MB)
Size limit50 MB per file
How it worksQuality is searched automatically until the file fits the target
Where it runsYour browser, using a canvas — nothing is uploaded

Limits worth knowing

  • The target is a ceiling, not a promise: a very small target on a detailed photo produces visible artefacts or cannot be reached, and the tool shows the closest result and flags it as not exact.
  • PNG is not offered as an output because lossless PNG cannot be tuned by quality; WebP is the better choice when you need transparency at a small size.
  • EXIF and GPS data are not preserved after re-encoding: use the EXIF remover if you need to be certain they are gone.

Tools we recommend