HomeGuides › Exact File Size

How to compress an image to an exact file size

Upload forms specify megabytes, not quality percentages. Give the tool the limit and let it find the setting.

Every portal that accepts a photo states its limit the same way: under 2 MB, maximum 500 KB, no larger than 200 KB. No form has ever asked for "JPEG quality 78". Yet almost every compression tool hands you a quality slider and leaves you to discover, by repeated trial, which number lands under the cap.

Step-by-step

  1. Open the tool. Go to Image Tools and choose "Exact File Size".
  2. Add your images. One or several — each is fitted to the target individually.
  3. Enter the limit. Type the number and pick KB or MB.
  4. Set a maximum dimension if it matters. Many forms cap pixel dimensions as well as file size.
  5. Compress and download. The status line reports the before and after sizes.

How it finds the setting

The tool searches quality levels for the highest one that still fits under your limit — a binary search rather than a guess, so it converges in a handful of attempts. Only if quality alone cannot get there does it start reducing the dimensions, in steps, retrying at each size. If a target is impossible without destroying the picture, it says so rather than handing you unusable mush.

That ordering matters. Dropping quality first preserves the pixel dimensions people usually care about; shrinking dimensions is the fallback, not the first move.

Practical notes

Frequently asked questions

Is the image uploaded?

No. The encoding attempts all happen in your browser, which is also why it's fast — there is no round trip per attempt.

Why is my result a little under the target rather than exactly on it?

Encoders don't produce a predictable size for a given quality, so the tool finds the best fit below your ceiling. Landing just under is the correct outcome; landing exactly on it would mean risking going over.

Does this change the image dimensions?

Only if it has to. Quality is reduced first, and dimensions are only touched when the target cannot otherwise be met — or when you set a maximum dimension yourself.

Open the exact-size compressor →