Compress image to 20KB
Give it a ceiling, not a quality number. The encoder quality is binary-searched and the image is downscaled when quality alone cannot get there, and the size you see is the size you download.
PNG is not offered here: it is lossless, so there is no quality knob to search.
Keeping resolution can make small targets unreachable on large photos — it will say so rather than guess.
createImageBitmap in this tab, drawn onto a canvas, and re-encoded with canvas.toBlob once per search step — all on your own CPU. The download link points at a blob: URL in the same tab. No server, no Pages Function, no model download.20 KB is a small budget: 20,480 bytes is roughly a third of what a single high-quality thumbnail usually costs. No photograph of any size survives it at full resolution — squeezing a 1500x1000 frame into 20 KB puts the JPEG encoder down around quality 0.07, which produces visible blocks on every flat surface and ringing along every edge. So this page deliberately spends resolution to buy quality back. It bisects the encoder quality parameter, sees that the best it can manage on the current rung is uncomfortable, steps down the resolution ladder, and searches again, up to four rungs or until the longest side reaches 400 pixels. The result is a small picture that still looks like a picture, and its exact byte count is shown before you download it.
Key facts about Compress image to 20KB
| What 20 KB means here | 20,480 bytes, measured from the encoded blob rather than estimated |
|---|---|
| Measured example | a 1500x1000 noisy photo of 1.29 MB lands at 20,407 bytes as JPEG — quality 0.36 at 675x450 |
| Same photo as WebP | 20,244 bytes at quality 0.76 and 450x300 — WebP trades one more resolution rung for a much higher quality figure |
| Full resolution at 20 KB | possible but ugly: quality drops to about 0.07 on the reference photo, which is where JPEG blocking becomes obvious |
| Realistic output size | typically 450x300 to 675x450 px for a photograph — avatar and form-photo territory, not a hero image |
| Easy inputs | flat graphics, logos and line art often reach 20 KB at high quality without any downscale at all |
| Search cost | 47-55 canvas encodes per image, roughly 190 ms for JPEG and 0.8 s for WebP on a desktop browser |
| Keep-resolution mode | still available and still reaches 20 KB on most photos — it simply looks worse, and the quality figure in the result strip says how much worse |
| Batch | 20 images per run, each with its own independent search |
| Transparency | flattened onto white, because neither JPEG nor the quality-searched WebP path preserves an alpha channel here |
| When it genuinely cannot | very large flat-colour PNGs converted with resolution locked can miss; the run is marked amber with the smallest size achieved |
What happens to your file
Nothing is uploaded. Your file is read as a blob in this tab, decoded with createImageBitmap, drawn onto a canvas element, and re-encoded by canvas.toBlob once for every one of the ~50 search steps — all native browser APIs, all on your own machine. This page issues no network request of any kind after it has loaded: no upload, no Pages Function, no CDN model download. The finished image is a blob: URL living in this tab's memory; reloading or closing the tab is all the cleanup there is, because no copy was ever made anywhere else.
About this tool
- 1
Keep the target at 20 KB
The page opens there. Every number quoted on this page was measured at 20,480 bytes on the same reference photo.
- 2
Prefer WebP if the destination allows it
At this ceiling WebP is meaningfully better: on the test photo it held quality 0.76 at 450x300 where JPEG held quality 0.36 at 675x450. More pixels is not automatically better when each one is wrong.
- 3
Leave the downscale ladder on
At 20 KB, locking resolution is the difference between a small clear photo and a full-size blocky one. Lock it only when a form validates dimensions.
- 4
Crop first if you can
A 20 KB budget is about how much detail fits, so removing background before compressing gives the remaining subject more of the budget.
- 5
Run and inspect the quality figure
The stats strip reports the quality the search settled on and the final pixel dimensions. A quality figure under 0.3 means this picture does not really fit in 20 KB, whatever the file size says.
- 6
Save the result
Each row gets its own Save link, and the filename carries the target — photo.jpg becomes photo-20kb.jpg.
| Accepted input | JPG, PNG, WebP, BMP, GIF, AVIF, TIFF, and HEIC/HEIF converted to JPEG on ingest |
|---|---|
| Output formats | JPEG or WebP |
| Per-file ceiling | 50 MB in, though at 20 KB out the input size barely matters — the resolution ladder does the work |
| Batch size | 20 files per run |
| Target presets | 20, 50, 100, 200 and 500 KB, plus a custom field from 5 KB upward |
| Minimum comfort size | the ladder will not shrink below a 400 px longest side purely to raise quality |
| Quality search | 10-step bisection between 0.05 and 0.95 on each rung, stopping at quality 0.55 |
| Browser support | canvas.toBlob everywhere; WebP output needs Chrome, Edge, Firefox or Safari 14+ |
| Account or install | none — no signup, no watermark, no daily quota |
- 20 KB ceilings usually come from form uploads that also specify pixel dimensions, such as 200x230 — resize to those dimensions first, then compress, and lock resolution.
- Line art, logos and screenshots of text reach 20 KB easily; skin tones, foliage and fabric do not, and the quality figure will tell you which case you are in.
- If the search returns quality below 0.3, consider whether a tighter crop or a simpler background would serve you better than any encoder setting.
- WebP at 20 KB is worth trying even when you expect to need JPEG — the comparison makes it obvious how much the format is worth at this ceiling.
- A photo destined for a 20 KB avatar slot will be displayed small; letting the ladder take it to 450x300 loses nothing you were going to see.
- Do not use a 20 KB image as the source for anything else later; re-compressing an already heavily compressed JPEG stacks artifacts.
- Resolution-for-quality trade built into the search
- Measured 20,480-byte ceiling, not an estimate
- WebP path that holds noticeably higher quality at this size
- Quality figure reported so you can judge the result
- 20-file batch with independent settings per file
- Explicit amber miss state when the target is unreachable
- Photo and signature uploads on examination or government application forms that cap files at 20 KB.
- Forum, chat and wiki avatars where the slot has a hard byte limit.
- Icon-sized assets for an email template that must stay tiny.
- Getting many images into a single attachment under a small total limit.
- Preparing placeholder or preview images for a site that lazy-loads a full-size version later.
- Squeezing screenshots into a legacy ticketing system with a per-file cap.
Related tools
View allWorks well with this6
More in Images12
Updated