Skip to main content
FixMyTech

Compress a Photo to an Exact Size in KB (20KB, 50KB, 100KB)

By

Published

7 min read

Share

Short answer

Shrink the pixel dimensions before you touch the quality slider. For a 50KB target, resize to roughly 600 × 800 pixels and export JPG at 75% quality, then adjust. Almost everyone drags quality to 20% on a full-resolution photo and gets a blurry, blocky mess — the same file size at smaller dimensions looks perfectly clean.

On this page

Indian passport portals want 20KB. University application forms want 50KB. Recruitment sites want 100KB. The instructions never say how, and the obvious move — dragging the quality slider to the floor — produces a photo so blocky that the form accepts it and a human later rejects it.

The fix is an order of operations, and it takes about ninety seconds.

Why forms set these limits

The numbers look arbitrary but they are not. Government and institutional portals were built to store millions of records on infrastructure sized years ago, and they often hold the photo directly in a database row rather than in file storage. A 20KB cap across ten million applicants is 200GB. A 2MB cap would be 20TB.

Two consequences follow:

  • The limit is a hard check, not a suggestion. There is no “slightly over”.
  • There is very often a minimum too, because an absurdly small file suggests a corrupted upload. Read the instructions again — if it says “10KB to 20KB”, a 4KB file fails just as surely as a 30KB one.

Resize the pixel dimensions first

This is the part almost everyone skips, and it is the whole difference between a clean 20KB photo and a smeared one.

File size is driven by how many bits of data you spend per pixel. A 4000 × 3000 photo has 12 million pixels. Forcing that into 20KB gives you about 0.013 bits per pixel, which is far below what JPG needs to represent anything. The encoder responds by throwing away almost all detail, and you get the characteristic 8 × 8 blocks.

Resize the same photo to 300 × 400 — 120,000 pixels — and 20KB gives you about 1.3 bits per pixel. That is a hundred times more data per pixel, and the result looks sharp.

Dimensions to target for each limit

Target size Suggested dimensions JPG quality Typical result
20KB 300 × 400 70% 15–25KB
50KB 600 × 800 75% 40–60KB
100KB 800 × 1000 80% 80–120KB
200KB 1000 × 1300 80% 150–250KB
500KB 1400 × 1800 80% 350–550KB

If the form specifies dimensions as well — passport photos commonly ask for 200 × 230 or 350 × 450 pixels — use those exactly and let quality do the rest. Never upscale to meet a dimension requirement if your source is smaller; crop and work from a bigger original instead.

Doing it in the browser

Our image compressor does both steps in one pass and shows you the resulting size per file, which is what you need when you are aiming at a number:

  1. Drop the photo in.
  2. Set Maximum width or height from the table above. Do this first.
  3. Set quality to the suggested value.
  4. Check the output size. Over the limit? Drop quality 5 points. Under the minimum? Raise it 5 points, or bump the dimensions up slightly.

It runs entirely on your device, so the photo is never uploaded — which matters when you are dealing with ID photos that carry location metadata from the phone that took them.

If your photo came off an iPhone as a HEIC file, convert it first with the HEIC to JPG converter. Many portals reject HEIC outright and report it as a generic upload error.

On a Windows PC

Paint is the fastest built-in route and it is genuinely adequate:

  1. Open the photo, click Resize, choose Pixels, untick nothing, and set the width. Keep Maintain aspect ratio ticked.
  2. File → Save as → JPEG picture.
  3. Check the size in File Explorer. Paint gives you no quality slider, so if it is still too large, resize smaller and save again from the original.

IrfanView (free) gives you the slider Paint lacks. Image → Resize then File → Save as, and the JPEG dialog has a quality control with a live size estimate. For a batch, File → Batch Conversion applies the same resize and quality to hundreds of photos at once.

On a phone

iPhone: the Photos app has no resize control, which is the gap people trip over. Crop tightly in Photos first — that genuinely reduces pixel count — then use a browser tool for the final size. Alternatively, open the photo in the Files app, long-press, and Quick Actions → Convert Image, which offers Small, Medium and Large. “Small” lands around 100–200KB.

Android: Google Photos has no resize either, but most manufacturer gallery apps do. On Samsung, open the photo, tap the three dots, and look for Resize image. On others, check the share sheet for a “resize before sharing” option. Failing that, the browser tool works identically on a phone.

Avoiding a blurry result

The usual culprits, in order of frequency:

You compressed before cropping. Crop to the final framing first. Cropping after compression means you are enlarging already-damaged pixels.

You went below 60% quality. At small dimensions you rarely need to. If 70% at 300 × 400 is still over the limit, the photo probably has a busy background — a plain backdrop compresses dramatically better than a bookshelf.

You re-saved the same JPG repeatedly. Every save re-encodes and compounds the previous losses. Always start again from the original, not from your last attempt.

You upscaled. Enlarging a 200px photo to 600px adds file size without adding a single pixel of real detail. The encoder then has to spend bits describing blur.

What not to do

  • Do not screenshot the photo to shrink it. You get an uncontrolled lossy copy at screen resolution, usually as a PNG, which is often larger.
  • Do not rename .png to .jpg. The extension is a label. The file contents are unchanged and strict upload validators check the actual bytes.
  • Do not zip the file. JPG is already compressed; a zip saves a percent or two, and no form accepts one.
  • Do not use a random online compressor for ID photos. Most upload your file to a server. Use something that processes locally.
  • Do not aim for the exact cap. Land 10–15% under. Some portals measure the base64-encoded payload, which is about a third larger than the file on disk.

What to expect

A 5MB phone photo resized to 600 × 800 at 75% quality lands around 50KB — a 99% reduction — and looks completely clean at the size any form will display or print it.

If you can see blocking, you compressed at the wrong dimensions rather than too hard. Go back to the original and resize first. The reasoning behind the quality numbers is in compress an image without losing quality, and if your problem is a megabyte-scale cap rather than a kilobyte one, reducing an image for an upload limit covers that case directly.

Frequently asked questions

How do I get a photo to exactly 20KB?
Resize to around 300 × 400 pixels first, then export as JPG at 70% quality. That typically lands between 15KB and 25KB. Nudge quality up or down 5 points to fine-tune — do not try to reach 20KB by compressing a 4000px photo, because the result will be unreadable.
Why does the form reject my photo when it is under the limit?
Most forms enforce a minimum size as well as a maximum, plus fixed pixel dimensions and sometimes a format restriction. A 12KB file can fail a "maximum 20KB" rule because the real rule is 10KB to 20KB at 200 × 230 pixels in JPG.
Does compressing to 50KB ruin the photo?
Not if the dimensions are right. A 600 × 800 photo at 50KB looks clean on screen and in print at passport size. A 4000 × 3000 photo squeezed to 50KB is roughly 0.004 bits per pixel and will show heavy blocking.
Can I compress to an exact KB value?
Not exactly — JPG encoders take a quality number, not a size target, so you land in a range. Aim for the middle of the allowed window rather than the edge, and re-export at a slightly different quality if you overshoot.
Should I use PNG for a 20KB limit?
No. PNG is lossless and a photograph saved as PNG is typically three to eight times larger than the JPG equivalent. For tiny size limits on photographs, JPG is the only realistic choice unless the form demands otherwise.

All Images guides