Skip to content

How to compress an image to 20 KB, 50 KB or 100 KB

A form that says “maximum 100 KB” is asking about bytes, not pixels. Here is what actually controls the byte count, in what order to change it, and what a browser-only compressor measured on real files.

The two levers, in the order to pull them

A JPEG or WebP file size is roughly pixels × how hard the encoder is allowed to throw detail away. So there are exactly two things to change:

  1. Quality. Keeps the dimensions, discards fine detail. Cheap, invisible at moderate settings, visible fast on text and faces.
  2. Dimensions. Fewer pixels means less detail to encode, so the target becomes reachable at a sane quality. This is the lever to pull when a tiny target keeps failing.

Start with quality. Only reduce dimensions when quality alone cannot reach the number, because a smaller picture cannot be un-smallened later.

What a target actually produced

These are measured results, not estimates: one 1600 × 1200 photograph of1,101,393 bytes (about 1.05 MB) was compressed in the browser to each target below, and the reported size is counted from the finished file:

  • Target 20 KB → 19,210 bytes, still 1600 × 1200
  • Target 50 KB → 50,511 bytes, still 1600 × 1200
  • Target 100 KB → 100,313 bytes, still 1600 × 1200

On this particular image, quality alone was enough at every target, so the dimensions never moved. A noisier or more detailed picture is not so obliging: when the quality range runs out before the target is reached, an honest tool says so and shows the smallest size it actually got, rather than labelling a miss as a success. That is the moment to cap the longest edge and try again.

When the number cannot be hit

  • PNG. Lossless, so its size is whatever the image needs. You cannot steer a PNG to 50 KB; if a form demands a KB ceiling, it almost certainly wants JPEG.
  • An image that is already smaller. Recompressing a 30 KB file to “100 KB” would only lose detail, so it is offered unchanged.
  • A tiny target on a busy picture. 20 KB for a 4,000-pixel-wide scan of dense text is below what the pixels can carry at a readable quality. Reduce the dimensions first, or accept the closest achievable size the tool reports.

Picking the format a form expects

Compress Image to KB can also change the format while it works. JPEG is the safe default: it has no transparency, so any transparent area is flattened onto the background colour you choose. WebP is usually smaller at similar quality, but older upload systems reject it. If the form names a format, produce that format and nothing cleverer.

Unsure what you are holding? Image File Inspector reads the real format, byte size and dimensions locally, before you commit to an operation. If the picture is also the wrong shape, resize it first withResize Image by Pixels — andthis guide covers doing that without distortion.

The order that works

  1. Check the current size and dimensions.
  2. Set the target the form states, in the format it states.
  3. Compress, then read the reported output size — not the target you typed.
  4. If the target was missed, cap the longest edge and repeat.
  5. Keep the original. Every pass throws detail away, and a twice-compressed JPEG never recovers.

None of this uploads anything: the file is decoded, re-encoded and measured by your own browser.