Image Compressor

Set a target file size in KB, and the tool adjusts JPEG quality until your image fits. Runs entirely in your browser.

Choose an image

Browse files

or drag and drop · JPEG, PNG, WebP — up to 50MB

Processed on your device. This file is never uploaded.

How the target-size compression works

Most image compressors give you a quality slider and let you guess what file size you'll end up with. This tool works the other way around: you tell it the file size you need, and it figures out the right quality setting automatically.

Under the hood, the tool draws your image onto a canvas, then exports it as a JPEG at different quality levels. It first checks both extremes — if full quality already fits your target there is nothing to trade away, and if the lowest quality still overshoots, the target is unreachable at this resolution. Between those bounds it binary-searches for the highest quality that still fits, usually converging in eight to twelve attempts.

When you'd use this

  • Government or university forms that require photos under a specific KB limit
  • Email attachments where the mail server rejects files over a certain size
  • Web uploads with strict file size constraints (profile photos, document scans)
  • Optimizing images for web pages where every kilobyte matters for load time

Transparency and JPEG

JPEG has no alpha channel, so transparent pixels have to become something. This tool composites them onto white before encoding. Without that step transparent areas would come out black, which is what a bare canvas produces by default. If you need transparency preserved, the Image Resizer can output PNG or WebP instead.

Technical details

Quality values range from 0.01 (heavy compression, visible artifacts) to 1.0 (minimal compression, near-original quality). The search converges quickly because JPEG file size scales roughly monotonically with the quality parameter.

All processing happens in your browser. The image data never leaves your device. Once the compressed image is generated, you can download it directly — there's no server round-trip involved at any stage.

Frequently asked questions