Home/Image Tools/Compress to Target Size
🎯

Compress to Target Size

FREE

Hit an exact KB or MB limit by searching for the right quality

Free · No sign-up required
Loading...

What Compress to Target Size does

Upload forms rarely say “use 80% quality”; they say “maximum 200 KB”. This tool takes a target size in KB or MB and finds the highest JPG or WebP quality that comes in under it, by encoding, measuring, and adjusting — typically in five to eight iterations. You get the file, the quality it settled on, and the achieved size. It runs in your browser; the image is never uploaded.

How the search works

1. Encode at quality q, measure size 2. Too big → lower q Too small → raise q 3. Repeat, halving the step each time (binary search) 4. Stop when size ≤ target and the step is below 1%, or after ~8 rounds Example, target 200 KB: q 0.80 → 340 KB q 0.50 → 190 KB q 0.65 → 250 KB q 0.57 → 215 KB q 0.53 → 198 KB ✓

Each round is a full encode of the image, so large photos take a second or two per step. The result is always at or under the target; it is never rounded up over it.

Common size limits

WhereTypical limit
Passport / visa photo uploads50–250 KB
Job and university application portals200 KB–1 MB
Government e-services (ID, tax, licence)100 KB–2 MB
Forum avatars and signatures50–100 KB
Email signature imagesunder 50 KB
CMS and marketplace product images1–2 MB
Email attachments (total)10–25 MB

When quality alone cannot get there

Compression can only do so much: a 6,000 × 4,000 photo will not reach 50 KB at any quality without looking terrible, because there are simply too many pixels. If the tool reports a very low quality (below about 0.4) for your target, the fix is fewer pixels, not more compression. Resize first with the Image Resizer — a 1,200 px wide version of the same photo reaches 50 KB at a perfectly acceptable quality — then run the target-size compression on the result.

TargetSuggested max dimensions before compressing
50 KB600–800 px on the long edge
100 KB800–1,000 px
200 KB1,000–1,400 px
500 KB1,600–2,000 px
1 MB2,000–2,500 px

JPG or WebP?

  • JPG when the destination specifies it, which most forms do. It is accepted everywhere.
  • WebP when the destination is a website you control or a modern platform: at the same target size WebP keeps noticeably more detail, or hits the target at a higher quality setting.
  • Check the form's accepted formats before choosing; a WebP rejected by the uploader saves nothing.

What the output does not contain

Like every canvas-based compressor, the output has no EXIF metadata — GPS, camera and date are removed, which is usually desirable for an upload. Dimensions are unchanged unless you resized beforehand, and transparency is lost in JPG output (filled white) but kept in WebP.

Frequently asked questions

The result is under the target but looks bad. What now?

The quality had to drop too far. Resize the image to fewer pixels and try again — you will reach the same size at a much higher quality.

Why is the achieved size a little under the target rather than exact?

JPEG size cannot be dialled precisely; the search stops at the first quality that fits. The gap is usually a few percent.

Can I set a target in pixels instead?

That is resizing, not compressing — use the Image Resizer. This tool targets file size in bytes.

Does it work on PNG input?

Yes. The PNG is decoded and re-encoded as JPG or WebP at the target size. The output is not PNG, since PNG's lossless compression cannot be tuned to a size.

How is size measured — KB as 1,000 or 1,024 bytes?

1 KB = 1,024 bytes and 1 MB = 1,024 KB, matching how operating systems report file sizes. Most upload forms use the same convention.

Is the image uploaded?

No. All encoding iterations run in your browser.

More tools in this category

🗜
Image Compressor
Re-encode JPG, PNG or WebP at a chosen quality to cut file size
📐
Image Resizer
Resize to exact pixels or a percentage with locked aspect ratio
Image Cropper
Crop freely or to 1:1, 4:3, 3:2 and 16:9 presets
🔄
Image Converter
Convert any image to JPG, PNG or WebP
💧
Image Watermark
Add a single or tiled text watermark with custom opacity
🔍
EXIF Data Reader
See camera settings, date and GPS location hidden in a photo