Skip to main content

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.

No watermarkFree & unlimited
Target file size
Output format

PNG is not offered here: it is lossless, so there is no quality knob to search.

When quality is not enough

Keeping resolution can make small targets unreachable on large photos — it will say so rather than guess.

Nothing is uploaded. The file is decoded by 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

Key facts about Compress image to 20KB
What 20 KB means here20,480 bytes, measured from the encoded blob rather than estimated
Measured examplea 1500x1000 noisy photo of 1.29 MB lands at 20,407 bytes as JPEG — quality 0.36 at 675x450
Same photo as WebP20,244 bytes at quality 0.76 and 450x300 — WebP trades one more resolution rung for a much higher quality figure
Full resolution at 20 KBpossible but ugly: quality drops to about 0.07 on the reference photo, which is where JPEG blocking becomes obvious
Realistic output sizetypically 450x300 to 675x450 px for a photograph — avatar and form-photo territory, not a hero image
Easy inputsflat graphics, logos and line art often reach 20 KB at high quality without any downscale at all
Search cost47-55 canvas encodes per image, roughly 190 ms for JPEG and 0.8 s for WebP on a desktop browser
Keep-resolution modestill 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
Batch20 images per run, each with its own independent search
Transparencyflattened onto white, because neither JPEG nor the quality-searched WebP path preserves an alpha channel here
When it genuinely cannotvery 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. 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. 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. 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. 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. 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. 6

    Save the result

    Each row gets its own Save link, and the filename carries the target — photo.jpg becomes photo-20kb.jpg.

Specs & compatibility
Accepted inputJPG, PNG, WebP, BMP, GIF, AVIF, TIFF, and HEIC/HEIF converted to JPEG on ingest
Output formatsJPEG or WebP
Per-file ceiling50 MB in, though at 20 KB out the input size barely matters — the resolution ladder does the work
Batch size20 files per run
Target presets20, 50, 100, 200 and 500 KB, plus a custom field from 5 KB upward
Minimum comfort sizethe ladder will not shrink below a 400 px longest side purely to raise quality
Quality search10-step bisection between 0.05 and 0.95 on each rung, stopping at quality 0.55
Browser supportcanvas.toBlob everywhere; WebP output needs Chrome, Edge, Firefox or Safari 14+
Account or installnone — 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.
Almost any photo can be made to fit; the question is what it looks like afterwards. On the reference 1500x1000 photograph the search produced 20,407 bytes at quality 0.36 and 675x450 pixels as JPEG, which is a perfectly usable form photo, and 20,244 bytes at quality 0.76 and 450x300 as WebP, which is visibly cleaner at a smaller size. Forcing the original pixel count into 20 KB is also possible — it lands near quality 0.07 — but the result is blocky enough that most people would rather have the smaller, clearer version.
WebP if the destination accepts it. Its advantage over JPEG grows as the budget shrinks, because JPEG's 8x8 block structure becomes visible long before WebP's does. The measured difference on the reference photo was quality 0.76 versus 0.36 for the same byte ceiling. Pick JPEG when you are uploading to a form, an older CMS or a government portal, because those frequently reject anything that is not JPG or PNG regardless of size.
Resize first, compress second, and lock resolution. Use the image resizer to hit the exact pixel dimensions the form specifies, then bring the result here, switch the second control to Keep resolution, and set the target. That way the downscale ladder cannot move you off the dimensions the form is checking, and the quality search still gets you under the byte ceiling. If the combination is impossible, the run comes back amber and you will know before you upload.
Because flat colour is cheap to encode. JPEG and WebP both spend most of their bytes on detail and texture; a logo with large areas of a single colour and a handful of edges compresses to a few kilobytes at high quality. The search finds that on the very first rung, hits its comfort threshold immediately, and stops. If your file was already under 20 KB and already in the format you asked for, it is returned untouched rather than re-encoded.
No. This page has no upload path at all. The decode, the drawing, the ~50 encode attempts and the final blob all happen inside this browser tab using canvas APIs; there is no server request after the page loads, and no WebAssembly engine is fetched either. That matters most on exactly this page, because a 20 KB target is usually an identity or application document. Nothing about the image, including its EXIF, reaches ToolChamp or anyone else — although note that the canvas re-encode also strips EXIF, so the output carries no location or camera data.
Only at small display sizes. A 450x300 or 675x450 image on a 2x display is effectively a 225x150 or 337x225 layout box before it starts to look soft. That is fine for an avatar, a form thumbnail or a list row, and not fine for anything shown large. If the destination displays the image bigger than that, argue for a larger ceiling rather than trying to win it back with encoder settings — there is no setting that puts detail back.
View all

Updated

We use anonymous analytics to improve ToolChamp. No personal data is stored or sold. Privacy Policy