How to compress an image to exactly 20KB, 200KB or 1MB
Job portals, exam forms and government websites all ask for the same thing: a photo under 20KB, a signature under 200KB, a document scan under 1MB. The frustrating part is that no tool has a button labelled "make this exactly 20KB". The size of a compressed image depends on the picture itself, so hitting a target takes a method, not a single setting — and this guide is that method.
Why forms ask for an exact size
Millions of photos to store
Upload limits are not there to annoy you. A portal that processes millions of applications stores every uploaded photo, and a 5 MB phone photo multiplied by a million applicants is an enormous storage bill. Small limits also keep pages fast for people on slow connections and stop one huge upload from clogging the system. That is why the familiar numbers keep appearing: 20KB for a passport photo, 50–200KB for a signature, and 1MB as the common ceiling for a scanned document or a profile picture.
A maximum, not an exact figure
The important detail is that the limit is almost always a maximum, not an exact figure. A form that says "photo must be under 20KB" will accept 18KB, 15KB or even 8KB. You do not need to land on 20,480 bytes; you need to land safely underneath it while the picture still looks acceptable. Once you accept that, the job becomes much easier.
The three levers that control file size
Dimensions first, then format and quality
Every image file's size comes from three things, and they matter in this order. First, dimensions: how many pixels wide and tall the picture is. A 4000 × 3000 phone photo holds 12 million pixels; halving each side leaves 3 million, so the file can shrink by roughly three quarters before quality is even touched. Second, quality: how aggressively the format discards detail it thinks your eye will not miss. Dropping a JPG from 95% to 80% quality is usually invisible on screen and can halve the file. Third, format: JPG and WebP throw detail away to save space, while PNG keeps every pixel exactly, which makes PNG files much larger for photographs.
The picture itself: a sky against a crowd scene
There is a fourth factor you cannot control: the picture itself. A plain blue sky compresses to almost nothing, while a crowd scene or a page of dense text resists compression because every pixel is different from its neighbours. Two photos with identical dimensions and settings can end up at very different sizes. That is why an exact-size button does not exist — and why you should judge the result by the file size you actually get, not by the settings you chose.
A method that hits the target
- Read the form's real requirements. Note the size limit and any required dimensions — many passport-photo rules specify both, for example 200 × 230 pixels and under 20KB. Dimensions come first because they are usually mandatory.
- Resize to the required dimensions. Use our Resize Image tool to set the exact width and height. If the form gives no dimensions, resize a phone photo to around 800–1000 pixels on the longest side; that alone often brings a 5 MB photo under 1 MB.
- Compress with the quality slider. Open the resized image in our Compress Image tool and drag the quality slider down in steps — start at 80%, check the size, then try 70% or 60% if you are still over the limit. The live preview shows you exactly when the picture starts to look worse.
- Switch format if you are still over. If JPG at 60% is still too big, try WebP, which is usually 25–35% smaller at the same visual quality. Use our Convert Image tool — but check first that the form accepts WebP, because some older portals only take JPG or PNG.
- Check the result before uploading. Open the final file and zoom in on the smallest detail — the eyes in a photo, the strokes of a signature. If it reads clearly, upload it. Never compress an already-compressed copy a second time; always go back to the resized original and adjust the settings there.
What to aim for at each size
20KB is the hardest target and it belongs to passport photos and signatures. Expect small dimensions — a few hundred pixels wide — and JPG quality around 60–70%. A signature on a white background compresses very well because most of the image is plain white; a busy colour photo at 20KB will look soft, so keep the dimensions as small as the form allows.
200KB is comfortable for most uploads: a profile picture or a form photo at 800–1000 pixels wide and 75–85% JPG quality usually lands well under it, and the picture still looks sharp on any screen. If you are over, drop the quality to 70% before you shrink the dimensions further.
1MB is generous. A full phone photo at 80% quality in JPG or WebP is usually under 1 MB, and a scanned document page at 150 DPI compresses easily to a few hundred kilobytes. If a file is over 1 MB, it is almost always because the dimensions are still in the thousands of pixels — resize first, and the problem usually disappears. The same idea applies to documents: our guide on compressing a PDF without losing quality explains why scans shrink so well and text PDFs do not.
When the target is too small
Sometimes the numbers simply do not work. A detailed colour photograph cannot be squeezed to 20KB and still look like a photograph — the form's own example photos are usually tiny for exactly this reason. If you have resized to the required dimensions and lowered quality to the point where the image is visibly damaged, stop: the form almost certainly expects the small dimensions, and a clean small picture beats a large damaged one. Check whether the form accepts a different format, or whether a scanned black-and-white version of the document qualifies, since black-and-white scans compress far better than colour ones.
One last warning: never trust a tool that promises an exact byte count by re-compressing your image repeatedly until it fits. Each pass throws away more detail, and the result is a picture that technically passes the limit but looks like it was photographed through frosted glass. One careful pass — resize, then quality, then format — gives you the smallest file that still looks like your photo.
Related guides
- How to Compress Images Without Losing Quality — shrink a photo without visibly losing quality.
- How to Resize Multiple Images at Once — resize a whole batch of images with consistent settings.
- How to Resize an Image Without Losing Quality — resize an image without it going soft.
Questions people ask
Can I compress an image to exactly 20KB?
You can get very close, but hitting an exact byte count on the first try is luck, not a setting. File size depends on the picture itself — a plain sky compresses far smaller than a busy crowd scene at the same dimensions and quality. The reliable method is to aim just under the limit: resize to the dimensions the form needs, then lower quality in steps until the file sits below 20KB. Being slightly under is what the form wants; it never requires the file to be exactly 20,480 bytes.
Is it better to resize or lower quality first?
Resize first. Dimensions are the biggest lever: halving the width and height quarters the number of pixels, so the file shrinks dramatically before you touch quality at all. Once the dimensions match what the form or website actually needs, lower the quality slider in small steps. Doing it the other way round — crushing quality while keeping a 4000-pixel-wide photo — leaves you with a large, ugly file.
Which format gives the smallest file: JPG, PNG or WebP?
For photographs, WebP is usually smallest, then JPG, then PNG by a long way — PNG is lossless, so a photo saved as PNG can be several times larger than the same photo as a JPG. The catch is acceptance: some older forms and portals only accept JPG or PNG, so check the form's allowed formats before you convert. If WebP is accepted, use it; if not, JPG is the safe choice for photos and PNG is the right choice for screenshots and images with text.