Compress Image to Target KB

Set a minimum, maximum or exact file size and this tool resizes + compresses your photo to fit it. It reads the real encoded file size after each quality step (no guesswork) using pure browser JPEG/PNG encoding. When a target is genuinely impossible — like the photo is too big to ever fit within the limit, or too small to reach a required minimum — the tool says so clearly instead of silently outputting a non-compliant file.

Loading…

Your files never leave your device. All processing happens on your device. No uploads, ever.

How to use Compress Image to Target KB

  1. 1

    Upload a photo

    Choose a JPEG or PNG image from your device.

  2. 2

    Set the target size

    Enter the required KB range or exact size.

  3. 3

    Set dimensions (optional)

    Provide the required pixel width and height, if any.

  4. 4

    Download

    Save the resized, compressed image locally.

How the compression works

Your photo is resized once to the target dimensions, then JPEG quality is binary-searched so the actual encoded byte count lands in your requested range. The tool only reports success when the real file size satisfies the spec.

What happens when the target is impossible

If even the lowest JPEG quality is still above your maximum, the tool reports it cannot hit the target (never a silent non-compliant file). If the image is too small ever to reach a required minimum, it reports that too.

Private by design

Decoding, resizing and encoding all happen in your browser with no canvas pixels ever uploaded to a server.

Frequently asked questions

Does it work entirely offline?

Yes. The image is decoded, resized and compressed fully in your browser; nothing is uploaded.

What if my image can't hit the target size?

The tool reports honestly that the file cannot satisfy the requested size rather than producing a non-compliant file, so you never submit a photo that is outside the official limit.

Which formats are supported?

JPEG and PNG. JPEG lets you hit exact pixel + byte targets; PNG is used where JPEG is not accepted.

Related tools

Last updated 7 August 2026