How to Compress an Image to an Exact Size (20KB, 100KB, 1MB)
Upload forms almost never ask for “good quality” — they ask for a number. Here is how to hit it.
Why do forms keep asking for “20 KB” or “50 KB”?
Government portals, exam registrations, visa systems and school databases are often built on old software with hard limits: 20 KB for a photo, 50 KB for a signature, 100 KB or 200 KB for a scanned document. Meanwhile a modern phone produces 3–5 MB photos. The gap is a hundredfold, which is why the upload keeps failing.
The good news: file size is one of the easiest things to control, as long as you understand the two levers involved.
Lever one: JPEG quality
JPEG compression throws away detail that human eyes are bad at noticing. At quality 90 the difference from the original is invisible; at quality 70 you can usually still read every letter of a document; at quality 40 photos start looking blotchy and text develops a grey halo.
The relationship between the quality number and the file size is not linear. Dropping from 95 to 85 often cuts the file size by half with no visible change.
Lever two: pixel dimensions
Halving the width and height removes three quarters of the pixels (0.5 × 0.5 = 0.25), and file size roughly follows pixel count. That is why shrinking the dimensions is the most powerful move available, and why a 4000 px photo can rarely be squeezed into 20 KB by quality alone — the tool would have to drop to quality 10 and the result would be unusable.
A realistic plan:
- 20–50 KB (ID photos, signatures): dimensions around 300–600 px, quality 60–75
- 100–200 KB (scanned documents, forms): dimensions 1000–1600 px, quality 70–85
- 500 KB – 1 MB (photos for email or chat): dimensions 2000–3000 px, quality 80–90
How an automatic “target size” search works
Instead of guessing, a good compressor does the guessing for you. It encodes the image at a high quality, measures the result, and adjusts — a bisection search. If even the lowest acceptable quality overshoots the target, it scales the image down by about 10 % and starts again. This repeats until the file fits, then reports the quality that was actually used.
That is exactly what the Image Compressor does: you type “100 KB”, it searches for the best-looking version under that limit and tells you which quality it ended up using. If the target is mathematically impossible (for example 20 KB from a 4000 px colour photo), it stops at the smallest sensible result and tells you the real number instead of silently producing a blurry mess.
Judge the output, not the slider
After compressing, always open the result and check the parts that matter: the face in a photo, the small print in a scan, the strokes of a signature. A file that is 2 KB under the limit but unreadable will be rejected by a human even if it passes the software.
Signatures deserve special care: a 50 KB limit with a 4000 px scan usually means the scan should be converted to a tight crop around the signature — most of the page is empty white paper, and empty white paper compresses to almost nothing but the sheer dimensions still inflate the file.
Compress without handing over the file
Neither the government portal nor a random compressor site needs to hold the document that contains your ID number. Everything on this site runs locally in your browser: you can compress a passport scan, disconnect from the network, and the tool keeps working. That is the point of the design.
Use the Image Compressor for JPG, PNG, WebP, HEIC and AVIF input, with a fixed target size in KB or MB.