Compress Image to 20 KB
Signature scans and thumbnail photos for online forms often have to be under 20 KB. The target is already set: drop your image and download the result.
Click to choose images, drag and drop them here, or paste with Ctrl+V
JPG, PNG, WebP. Select more than one to compress in bulk. Stays on your device, nothing is uploaded.
Your compressed image will appear here once generated.
For JPEG/WebP, it binary-searches quality at your image's original size. If "Allow resizing" is off and quality alone can't hit the target, you'll get the smallest size possible without changing dimensions. PNG is lossless, so hitting a small target needs resizing turned on. JPEG or WebP will get you much closer to a small target at full size.
Getting a clean image under 20 KB
20 KB is a very small budget. It is the usual ceiling for signature scans and small ID thumbnails on application portals, and it is tight enough that a full-resolution phone photo cannot fit without being scaled down. Leave Allow resizing on: the tool first tries your original dimensions, and only shrinks the image when no quality setting fits.
For a signature, crop tightly around the ink before compressing. White paper compresses almost for free, so a tight crop spends the whole budget on the strokes, and a 300 to 400 pixel wide signature stays crisp at 20 KB. For a face photo, expect roughly 250 to 350 pixels on the long side to look clean; beyond that, JPEG blocking starts to show around hair and edges.
Use JPEG output. PNG is lossless, so its size depends on the content and it will usually overshoot a 20 KB limit for photos. If the form states exact pixel dimensions as well as a size limit, resize to those dimensions first with Resize Image, then compress here.
How it works
The quality search for JPEG and WebP runs eight rounds of binary search over the encoder's quality parameter: encode at 0.5, compare the byte count against your target, then halve the interval up or down and encode again. Eight rounds pin the quality value down to within about 0.4% of its full range, which is why results usually land just under your target rather than far below it. With resizing enabled, that same search repeats at progressively smaller dimensions, shrinking 15% per step, until it finds a scale where quality alone can close the remaining gap.
PNG needs a completely different lever, because the browser's canvas encoder only
writes full truecolor files and has no quality knob at all. So this page ships its own
indexed-color PNG encoder: a median-cut quantizer builds a palette of 128 down to 8
representative colors, Floyd-Steinberg dithering diffuses the rounding error so
gradients don't turn into visible bands, and the palette indices are compressed with
the browser's native CompressionStream and written byte by byte into a
valid color-type-3 PNG, one byte per pixel instead of three or four. That's the same
technique pngquant and TinyPNG use, and on screenshots and flat graphics it routinely
cuts 60-80% without resizing. It requires a fully opaque image, since indexed PNG can't
store per-pixel transparency.
A practical shortcut before you reach for resizing: at equal visual quality, WebP files come out roughly a quarter to a third smaller than JPEG, so an image JPEG can't squeeze under your target at full resolution often fits once you switch the output format to WebP.
All of this runs against an in-memory canvas in this tab. You can verify it: open DevTools, switch to the Network tab, and compress something. No request ever carries your image, in either direction, and the tool keeps working with Wi-Fi switched off.
Common questions
Why can't it always hit my exact target size?
For JPEG and WebP the tool binary-searches the quality setting at your image's original dimensions. If even the lowest quality is still bigger than your target, you get the smallest file possible without changing the width and height. Turn on "Allow resizing" to let it shrink dimensions too, which reaches much smaller targets.
Which image formats are supported?
You can drop in JPG, PNG, or WebP files and export as JPEG, WebP, or PNG. JPEG and WebP give the best size control because their quality setting is adjustable. PNG is lossless, so its size varies and small targets usually need resizing turned on.
Is my image uploaded anywhere?
No. Compression happens entirely in your browser using the canvas API, so your images never leave your device. That also means there's no server-side file size cap or upload queue.
Can I compress several images at once?
Yes. Select or drag in multiple files, set one target size, and hit "Compress all". You can download the results one by one or grab everything as a single .zip.
From the blog: How to Compress Images Without Losing Quality