OnlineAITool
Image Tools

Compress JPEG to 20 KB

Compress a JPEG file to under 20 KB, keeping JPEG as the output format.

Target: under 20 KB
Dimensions: Original ratio kept
Choose an image or drag it here under 20 KB · JPG, PNG, WebP or HEIC in · JPEG out · paste from the clipboard works too

How to use this tool

  1. Choose your image, drag it onto the box, or paste it from the clipboard. JPG, PNG, WebP and HEIC all go in; JPEG comes out.
  2. There is nothing to set. This page is already fixed at under 20.0 KB, JPEG.
  3. It scales the image down first — on our reference file, to 506 × 675 px — then searches the encoder quality. That run took 7 encodes.
  4. Download from the panel, which shows the original size, the final size and the output dimensions. Nothing was uploaded at any point.

JPEG is the right format for photographs and reaches small sizes efficiently. The tool searches quality levels to land just under 20 KB.

Compress JPEG to 20 KB — the specification

Target file sizeUnder 20 KB
Output formatJPEG
MethodBinary search over JPEG quality
TransparencyFlattened onto white

Compress JPEG to 20 KB: why uploads get rejected

Landing under 20 KB is necessary but not sufficient. These are the reasons a file that meets the size still gets sent back:

  • The source was a PNG screenshot converted to JPEG — text and sharp edges pick up visible artefacts. For screenshots, keep PNG.
  • The image was already heavily compressed, so re-compressing degrades it further.
  • The dimensions are large enough that 20 KB forces heavy quality loss. Reduce the dimensions first.

How it works

Hitting a size limit exactly is a search problem, not a setting. There is no quality value that means “20.0 KB” — how many bytes a given quality produces depends entirely on the picture. So this tool encodes, measures the real file, and adjusts.

It starts by capping the pixel count, because quality alone cannot rescue an image that is simply too large. On the reference file measured below that meant going from 1200 × 1600 to 506 × 675 before the first encode. That ordering is what keeps the search cheap: the six or seven encodes that follow all work on the smaller image.

It then binary-searches the quality parameter: encode, measure, halve the remaining range, repeat. The run below took 7 encodes to land at 19.6 KB. A tool that picks one fixed quality instead either overshoots the limit or comes in far under it and throws away detail you did not need to lose.

Every one of those encodes ran on your own device through the browser’s canvas API — including the intermediate attempts the search threw away. None of them was uploaded.

A measured run of this exact preset

Not an estimate: this page’s own code, run against a 2 MP photograph and an A4 scan at 200 dpi, with every encode recorded. The files and the method are published here.

InputResultChangeOutcome
2 MP photograph
1200 × 1600 px · 460.0 KB
19.6 KB
506 × 675 px
96% smallerUnder the 20 KB limit
A4 scan at 200 dpi
1654 × 2339 px · 996.0 KB
19.3 KB
491 × 695 px
98% smallerUnder the 20 KB limit

Step by step

Before touching quality at all, the tool worked out how many pixels 20.0 KB can realistically describe, and scaled the image from 1200 × 1600 down to 506 × 675 — 82% fewer pixels. Doing this first is what keeps the run quick: every attempt after it encodes the smaller image rather than the original.

The first probe at quality 0.96 came out at 96.0 KB, about 4.8× the 20.0 KB limit, so the search began.

It then narrowed the quality setting 6 times — quality 0.51 gave 15.4 KB, quality 0.73 gave 25.8 KB, quality 0.62 gave 18.9 KB, quality 0.68 gave 21.7 KB, and so on — settling on quality 0.64.

Final file: 19.6 KB, using 98.1% of the allowance, with 396 B to spare.

Who needs Compress JPEG to 20 KB

Situations where the output format is fixed — a form that accepts only JPEG, or a workflow where the format must not change.

Compress JPEG to 20 KB — frequently asked questions

Why keep JPEG rather than convert?

JPEG is the most widely accepted format on upload forms and the most efficient for photographs. Keeping the format avoids compatibility surprises.

How does the quality search work?

It encodes at a mid-range quality, measures the file, and narrows the range seven times, keeping the largest result under 20 KB.

Will the file still be under 20 KB after I save it again?

Yes, as long as you do not re-encode it. Downloading and uploading the same file changes nothing. Opening it in an editor and saving again re-compresses it and can push the size back up, so upload the file you downloaded here rather than a copy you have edited.

Which file types can I upload?

JPG, PNG, WebP, GIF, BMP and HEIC from an iPhone all go in. The output here is JPEG. Conversion happens as part of the process, so there is no need to convert first.

Does this work on a phone?

Yes, including photos straight from your camera roll. The work happens on the device, so a very large image is slower on a phone than on a laptop, but nothing is uploaded either way.

Is this tool really free?

Yes. No account, no trial period, no watermark on the output and no cap on how many times you use it. The site is funded by advertising.

Is 20 KB the right target, and what you actually get

Where this limit comes from: The most common photograph limit on Indian exam forms: SSC, UPSC and many state boards.

At 20 KB the quality setting alone cannot reach the target, so the image is scaled down as well — to 42% of its original width in the measured run. That is the trade-off this limit forces. If the form accepts more, the next step up keeps noticeably more detail.

The same source file put through this target and the ones either side of it, measured rather than estimated:

TargetResultFinal size in pixelsScaling applied
20 KB (this page)20 KB506 × 675 px42% of original width
50 KB49 KB1067 × 800 px27% of original width

If the portal gives a range rather than a hard number, take the largest it allows. Every step down this ladder costs detail that cannot be recovered afterwards.

Related tools

From other categories

Your photo never leaves your device. Open your browser's Network tab while you use this page and you will see no upload — how that works.

Disclaimer. Published requirements change without notice. Confirm against the official source before you submit. Full disclaimer.