Compress image to 20KB — and what 20KB actually holds
A 20KB JPG holds about 630 × 470 pixels of an ordinary photograph — 0.3 megapixels, 6.6 inches wide on a 96 ppi screen, or a 2.1 inch print at 300 dpi. That is measured, not estimated: a 905 KB 2592 × 1944 JPEG run through this compressor with a 20 KB target came back at 630 × 472 px, 19.7 KB, quality 40%.
The short answer
The same 20 KB buys a very different number of pixels depending on what the picture contains:
- Photograph: ~630 × 470 px (0.30 MP)
- Page of text: ~298 × 398 px (0.12 MP)
- Flat artwork or logo: ~1000 × 1000 px (1.0 MP)
- Smooth gradient: ~2100 × 1400 px (2.9 MP)
A 25× spread for the same file size. The table below is where each number came from.
How these numbers were measured
Every number here comes from runs of this site's own compressor, not from a formula. I loaded six fixed test images one at a time, set the target to 20 KB, chose an output format, pressed compress, and recorded what the tool reported: output dimensions, output byte count and the JPEG quality it settled on. Nothing was re-encoded afterwards.
- Tool: the ExactSize compressor on this site, run on 18 October 2026.
- Browser: Chrome 155.0.8059.80 on Windows 11, desktop. Canvas encoding differs slightly between browser engines, so treat the last digit of any byte count as browser-specific.
- Target: 20 KB, which the tool reads as 20,480 bytes. Every result came back at or under that, as it should.
- Test images: a landscape photograph from Wikimedia Commons
(
Bachalpsee_reflection.jpg, 2592 × 1944), the same photograph reduced to 1280 × 960, a 1200 × 1600 page of 26 px Arial text rendered to PNG, a 2400 × 1600 smooth vertical gradient, a 4000 × 4000 flat-colour graphic with large blocks of solid colour, and a 3600 × 3600 PNG with a transparent background.
Six images, one 20 KB target
This is the whole result set. The last two columns are what make the table useful: bytes per pixel says how expensive that kind of content is to store, and quality says how hard the encoder had to work.
| Image | Source | Output at 20 KB | Output bytes | Megapixels | Bytes / pixel | Quality |
|---|---|---|---|---|---|---|
| Photograph, landscape | 2592×1944 · 905 KB | 630×472 | 20,214 | 0.30 | 0.068 | 40% |
| Same photo, smaller start | 1280×960 · 265 KB | 622×467 | 20,176 | 0.29 | 0.070 | 40% |
| Page of text | 1200×1600 · 228 KB | 298×398 | 20,317 | 0.12 | 0.171 | 41% |
| Smooth gradient | 2400×1600 · 2.42 MB | 2097×1398 | 20,480 | 2.93 | 0.0070 | 40% |
| Flat artwork | 4000×4000 · 82 KB | 1002×1002 | 20,318 | 1.00 | 0.020 | 43% |
| Transparent cutout | 3600×3600 · 61 KB | 1402×1402 | 20,410 | 1.97 | 0.010 | 43% |
Measured 18 Oct 2026 in Chrome 155, output format JPG, target 20 KB (20,480 bytes). Source sizes are the files as loaded; output dimensions and quality are what the tool reported after compressing.
Why one 20 KB file holds 25× more pixels than another
JPEG spends bytes on change. A smooth gradient changes almost nothing from pixel to pixel, so it costs almost nothing to store — the 20 KB budget stretched to 2.9 megapixels. A page of text is the opposite: every letter is a hard black-to-white edge, and edges are exactly what the encoder has to spend on. That is why text got the smallest result of the six, 0.12 megapixels, even though the source was only 228 KB.
Turned into a single number, the measurement gives a rough predictor. Divide pixels by kilobytes and you get how many pixels one kilobyte buys for that kind of content:
| Content | Pixels per KB at 20 KB | What 20 KB holds |
|---|---|---|
| Page of text | 5,978 | 298×398 |
| Photograph | 15,064 | 630×472 |
| Flat artwork | 50,600 | 1002×1002 |
| Transparent cutout | 98,632 | 1402×1402 |
| Smooth gradient | 146,580 | 2097×1398 |
Derived from the table above: output pixels ÷ output kilobytes. Use it as an order-of-magnitude check, not a guarantee — a different photo can land 20–30% either side of 15,064.
The target size matters as much as the content
I also ran the same photograph and the same page of text at 50 KB and 100 KB. Pixels per kilobyte goes up as the target grows, which is not obvious: a 100 KB file holds more pixels per KB than a 20 KB file does, because the fixed overhead of a JPEG header and the per-block tables is amortised over a larger picture.
| Target | Photograph output | Pixels / KB | Text page output | Pixels / KB |
|---|---|---|---|---|
| 20 KB | 630×472 | 15,064 | 298×398 | 5,978 |
| 50 KB | 1077×808 | 17,453 | 479×638 | 6,230 |
| 100 KB | 1621×1215 | 19,706 | 719×959 | 6,938 |
Same two source files as above, measured the same way. Going from 20 KB to 50 KB is 2.5× the bytes but 2.9× the pixels; 50 KB to 100 KB is 2× the bytes and 2.3× the pixels.
JPG, WebP or PNG at 20 KB
Format changes the answer more than any other single choice. Same photograph, same 20 KB target, three output formats:
| Format | Output at 20 KB | Megapixels | What happened |
|---|---|---|---|
| JPG | 630×472 | 0.30 | Quality pinned at 40%, dimensions cut to 24% |
| WebP | 764×573 | 0.44 | Same 40% floor, but 47% more pixels fit |
| PNG | not reachable | — | Tool returned “This target is not reachable for this image” |
Measured 18 Oct 2026, Chrome 155, same 905 KB source file. “Not reachable” is the tool's own message.
PNG has no quality dial, so the only lever is pixel count, and it loses badly on photographic content. For comparison, the same photo as PNG came back at 168 × 126 for a 50 KB target and 245 × 184 for 100 KB — against 1621 × 1215 for JPG at 100 KB. PNG is not useless at 20 KB, though: the flat artwork, which has no photographic detail, held 497 × 497 as PNG where JPG held 1002 × 1002. If your image is a logo or a diagram with a handful of flat colours, PNG at 20 KB is workable. If it is a photograph, it is not.
Why the dimensions shrink: the 40% quality floor
Every JPG and WebP result in the table came back at quality 40% or 43%. That is not a coincidence. The compressor holds your pixel dimensions and trades quality away only as far as 40%; below that it reduces the picture instead, because a 630 × 472 photo at 40% looks better than a 2592 × 1944 photo at 6%.
This is worth knowing before you compress, because it decides what you get. At 20 KB you are almost always past the floor: the source photograph would have had to go far below 40% to stay at its original size, which the tool will not do and which would not look good if it did. So at 20 KB, plan for smaller dimensions, not for a soft but full-size image.
How to compress an image to 20 KB, step by step
- Open the compressor. It runs in the page; there is no sign-up.
- Drop your image on the box, or click it to pick a file. JPG, PNG, WebP, GIF and BMP all load.
- Click the 20KB preset. If you need the exact byte figure, type
20and leave the unit on KB — the tool reads that as 20,480 bytes, which is what a “20 KB” limit usually means. - Choose JPG for photographs, WebP if the place you are uploading to accepts it (it fits about 47% more pixels in the same 20 KB), or PNG only for flat artwork and diagrams.
- Press Compress image. The result panel shows the output dimensions, the output size and a one-line verdict telling you whether the dimensions were kept or scaled.
- Download, then check the file size in your file manager before uploading it anywhere. The tool will not hand you anything above 20 KB, but the portal you are uploading to may measure kilobytes differently — some count 1 KB as 1,000 bytes, not 1,024.
What a 20 KB image actually looks like
I opened each output at its real pixel size and looked at it, rather than judging by the byte count. Four different verdicts from the same 20 KB budget:
- Landscape photograph, 630 × 472: holds up well on a phone screen. Sky and water are smooth, the mountain ridge is soft but intact. What goes first is fine texture — grass and gravel turn into mush at 100%.
- Page of text, 298 × 398: the headline is still readable and so are the body lines, but the letterforms are broken at 100% and there is ringing around the strokes. Fine for a thumbnail of a document, not for anything someone has to read carefully.
- Flat artwork, 1002 × 1002: clean. Edges are crisp and the wordmark is sharp; the only artefact is faint colour fringing where white meets blue.
- Transparent cutout, 1402 × 1402: the transparency is gone — JPG has no alpha channel, so the background became white — and the hard shape edges carry a faint halo. If you need the transparency, do not use JPG at 20 KB.
- Smooth gradient, 2097 × 1398: it kept 87% of the original dimensions, but the ramp shows faint horizontal banding. Smooth areas are cheap, so the budget stretches a long way here; the trade-off is visible steps.
If 20 KB is too small for the dimensions you need
At 15,064 pixels per KB, 20 KB is roughly a 0.3 megapixel budget for a photograph. If a form demands 20 KB and also demands 1200 × 1600, the two requirements cannot both be met by a detailed photo — no compressor can do it, because the pixels are not there. The realistic options, in order:
- Switch to WebP if the destination accepts it: 764 × 573 instead of 630 × 472 at the same 20 KB, measured above.
- Crop before compressing. A tighter crop spends all 20 KB on the part that matters instead of on background. This is the only way to keep detail at a fixed byte budget.
- Reduce the colour complexity. A busy background costs more bytes than the subject. Flattening a background to one colour can buy a surprising amount of resolution.
- Check whether the limit is really 20 KB. Plenty of forms say “20 KB” but accept up to 2 MB, or apply the limit only to a thumbnail.
Questions people ask about 20 KB images
How many pixels is a 20 KB image?
About 300,000 for a photograph (630 × 472 measured), about 119,000 for a page of text (298 × 398), about 1.0 million for flat artwork and up to 2.9 million for a smooth gradient. The file size alone does not determine the pixel count; the amount of detail does.
Can a 4000 × 3000 photo be compressed to 20 KB?
To 20 KB, yes. At 4000 × 3000, no. That is 12 megapixels, and at the measured 15,064 pixels per KB a 12-megapixel photo needs roughly 800 KB. At a 20 KB target the same photo landed at 630 × 472.
Does compressing to 20 KB always reduce the dimensions?
In all eight 20 KB runs that produced a file, yes — quality hit the 40% floor and the tool shrank the picture instead. A ninth run, the same photo as PNG at 20 KB, refused the target outright. If a file is already under 20 KB and already a JPG, it is passed through untouched.
Is 20 KB enough for a 600 × 600 passport photo?
600 × 600 is 360,000 pixels, about 20% above what the landscape photograph reached at 20 KB. A portrait against a plain background carries much less detail than a landscape, so it can fit where the landscape did not; a busy background will not. Compress the actual file and look at the result before you submit it — do not trust a rule of thumb, mine included.
Does the image get uploaded?
Not here. The file is read with the browser's File API, drawn onto a canvas and re-encoded with
canvas.toBlob(), all inside the page. Load the page, switch off your Wi-Fi, and it still
compresses.
All measurements on this page were taken on 18 October 2026 with Chrome 155.0.8059.80 on Windows 11, using this site's compressor and the six test images described above. Byte counts and the exact dimensions the encoder lands on vary a little between browsers and between images of the same kind.