Walnut Tools

Compress Image to a Target Size (KB)

Shrink a photo, scan or signature to fit an upload limit such as 20 KB, 50 KB, 100 KB or 1 MB, keeping as much quality as possible.

Drop images here
JPG, PNG, WebP, AVIF, HEIC (where your browser supports it)

Processed locally in your browser. Nothing is uploaded.

When you need an exact file size

Application portals, exam registrations, visa forms, job sites and email systems often reject images above a fixed size, and some also require a minimum. Phone cameras produce 2–8 MB photos, far above typical limits like 50 KB for a passport-style photo or 20 KB for a signature. Re-saving in a photo editor means guessing quality settings over and over; this tool does that search for you.

How it finds the best quality

  1. It encodes your image at high quality. If that already fits, you get it straight away.
  2. Otherwise it runs a binary search on the quality setting, about eight test encodes, to find the highest quality that stays under your limit.
  3. If even low quality is too big, it reduces the image dimensions in proportion to how far over the limit it is, then searches again.

Tips for forms

Frequently asked questions

Why is the result a little under my target, not exactly on it?
JPEG and WebP sizes jump in small steps as quality changes, so landing on an exact byte count is not possible. The tool finds the highest quality that stays at or below your limit, which is what upload forms check.
Does 1 KB mean 1000 or 1024 bytes here?
The tool treats 1 KB as 1000 bytes. Forms differ: some count 1024. Using 1000 means the file is under the limit either way.
My form needs a minimum size too, e.g. 20–50 KB. What should I enter?
Enter the maximum (50). The tool keeps as much quality as fits, so the result will normally be close to 50 KB. If your original photo is already smaller than the minimum, use a higher-resolution original.
Will the image dimensions change?
Only if needed. The tool first lowers quality. If the file is still too large at low quality, it scales the dimensions down step by step until it fits. You can also set a fixed maximum width.
Is my photo uploaded?
No. Compression runs entirely in your browser, so ID photos, signatures and documents stay on your device.