Compress image to exact KB
Enter a target size in KB. The tool binary-searches quality (and drops dimensions if needed) until your image is genuinely under that target — not just close. Runs entirely in your browser.
WebP is typically 25–35% smaller at the same quality — useful when the target is aggressive.
Runs entirely in your browser — nothing is uploaded.
Why this exists
Most "compress to N KB" tools apply a fixed set of quality and dimension settings and hope the output lands close to the target. That's fine for casual use, but it fails the case where you need to guarantee the file is under a specific byte limit — a form upload capped at 100 KB, a corporate email attachment ceiling of 2 MB, a job-portal photo spec that hard-rejects anything over 50 KB.
This tool iterates. It picks a starting quality, encodes, checks the byte count, then binary-searches until it finds the highest quality that lands under your target. If the highest-quality version is still too big, it drops the image dimensions by 20% and repeats. In practice the tool converges in 3-6 attempts.
When to use this vs. the preset target-size pages
The preset pages (/compress-image-to-100kb, /compress-image-to-500kb and so on) are optimised for one-click use — drop and go. This tool is a better choice when the target size is a hard requirement rather than a rough goal, or when the target isn't one of our standard presets (17 KB, 340 KB, 1.8 MB — anything specific).
Related tools
- Compress image (manual controls) — best when you want to eyeball quality yourself.
- Bulk compress — apply the same target to a folder of images.
- Resize image — crop or downscale first if your source is much larger than the target render size.
- WebP converter — for a broader quality/format trade-off audit.
Your images stay on your device. Nothing is uploaded.
Supported formats and how processing works
- Files you can open
- JPG, PNG and WebP, up to 25 MB each. iPhone HEIC/HEIF photos open only in the HEIC to JPG converter. PDFs open in the PDF to image tool.
- Files you can save
- JPG, PNG and WebP. WebP and AVIF output depend on your browser's encoder (in our tests, Chrome could not create AVIF). If your browser can't produce the format you picked, the tool tells you instead of saving a different format under the wrong file extension.
- Where the work happens
- In your browser, using its built-in canvas image encoder. The tools contain no upload step, so your image is not sent to our server. Our analytics (Google Analytics with Consent Mode) records usage numbers such as file size and format, never the image itself.
- What changes in the file
- The image is re-encoded, so camera metadata (EXIF, including GPS) is not carried over. JPG has no transparency, so transparent areas become white. PNG is lossless: to shrink one, reduce its dimensions or convert it to WebP.
More image tools
All free, all in your browser.