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 to read these numbers: six images, one per content type — six sample points, not a distribution. They show how far apart content types sit, not the spread within one type. And every figure below was produced after the compressor hit its 40% quality floor, at which point it stops lowering quality and reduces the pixel dimensions instead. This page is the budget question — how much picture each content type fits into 20 KB. The other question, what a single large file does at every target from 20 KB to 2,400 KB, is measured on the 4000×6000 ladder page.
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 is a sample, not a distribution. Each content type is represented by a single file, so the table has six data points. That is enough to show how far apart a photograph and a page of text sit — a 25× difference — and it says nothing about the range inside one type. A different photograph can land well either side of 15,064 pixels per KB, and a different page of text well either side of 5,978. Read each number as the right order of magnitude for that kind of image, not as a guarantee for any particular file.
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. Six images, one per content type — six sample points, not a distribution. All six outputs were produced after the tool's 40% quality floor was reached, at which point it stops lowering quality and reduces the pixel dimensions instead.
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%.
Every pixel count on this page was produced after that floor was hit. In all eight 20 KB runs that returned a file, the quality the tool reported landed between 40% and 43%, and the dimensions it handed back were 24% to 87% of the original. So these numbers describe what the compressor does once it has run out of quality to give — not what a hypothetical lower-quality encode at full size would look like, because the tool will not produce one.
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.
If the tool has already refused your file rather than shrunk it, that is a different problem — the message it printed and the format setting behind it are covered in why a big file stops at 20 KB, with the measured ladder from 2,400 KB down to 20 KB on one 4000×6000 file.
10 KB and 15 KB: the two budgets just below this page
Plenty of forms ask for less than 20 KB, and the same photograph answers them on the same curve. One 3000 × 2000 night photograph, 673 KB, run at three budgets in one session:
| Target | Output bytes | Output | Output px | Quality | Mean error |
|---|---|---|---|---|---|
| 10 KB | 10,210 | 623 × 415 | 258,545 | 41% | 3.110 |
| 15 KB | 15,152 | 812 × 542 | 440,104 | 40% | 2.863 |
| 20 KB | 20,385 | 968 × 646 | 625,328 | 40% | 2.701 |
One file, three targets, one run each, 2 November 2026. Mean error is the average absolute per-channel difference against the source, 0–255 scale.
Five kilobytes buys 181,559 pixels between 10 KB and 15 KB, and 185,224 between 15 KB and 20 KB — 36,300 and 37,000 pixels per kilobyte, almost the same rate at both steps. That is the useful thing to know if you are choosing between a 10 KB and a 15 KB limit: the smaller budget is not disproportionately punishing, it is the same curve cut earlier. Dropping from 15 KB to 10 KB costs 70% of the pixels and adds 0.25 levels of error, which is the whole trade in one sentence.
The 10 KB row is also the only one of the three where the encoder did not sit on its floor: 41% quality. At that budget the dimensions had already been cut to 21% of the source (623 ÷ 3000) and there was still a sliver of quality left above 40%. If you compress image to 10kb and the result looks worse than you expected, that is not the floor failing — it is 258,545 pixels doing the work of 6,000,000. A form that asks you to compress image to 15kb sits between the two rows above, at 440,104 pixels. The same curve keeps going up: the 60 KB page runs the identical file at ten budgets and finds where the frame stops being cut.
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. For the same trade at a larger budget, and why a PNG behaves differently from a JPG, the 100 KB PNG page measures five content types against a 102,400-byte limit. The 50 KB budget is measured separately on the 50 KB page, where the question is what happens to the same photograph when the starting resolution changes. What 100 KB covers at the pixel sizes that passport and visa forms actually name is on the JPG at 100 KB page.
A different kind of answer is India's: a form that publishes a photo size of 4.5 cm by 3.5 cm and no pixel count, no DPI and no file-size limit anywhere in the passport office's own pages. That spec, quoted sentence by sentence with the date each page was read, is on the Indian passport photo size page.
The numbers above are one file at a time. What happens when a whole folder is pushed through at 20 KB — six different limits landing between 189 × 189 and 1,545 × 773 pixels, what a single folder-wide limit costs, and why 19 KB is the safer setting when a form means 20,000 bytes rather than 20,480 — is measured on the 20 KB folder run.
If the problem is not the size but the format — the form wants JPG and you have a PNG — the conversion itself has its own behaviour worth knowing: it discards the source container entirely (PNG, JPG and WebP exports of one picture land within 9 bytes of each other), fills transparency with white, drops the EXIF block, and can return a file larger than the one you put in. Those four outcomes are measured on the convert to JPG at 20 KB page.
Why a JPEG behaves differently from a PNG at this size: a JPEG is rebuilt in 8 × 8 pixel blocks and gives up pixels before it gives up quality, which is why 89 of 102 measured runs reported 40.5% — on the JPEG at 20 KB page.
A larger budget, measured the same way: how many pixels 200 KB holds for a photograph, a text page, flat artwork and a gradient, and why a 1.5-megapixel photo keeps every pixel there while a 6-megapixel one does not, is on the 200 KB page.
A far more generous budget, measured the same way: how many pixels 1 MB holds for a photograph, a scan, a text page and flat artwork, and the fifteen runs where twelve kept every pixel, is on the 1 MB page.
The budget in between, measured the same way: 500 KB holds 8.41 megapixels of a photograph (2367 × 3551), and eleven budgets on one ladder show why doubling to 1 MB returns 2.28× the pixels rather than 2× — on the 500 KB page.