iPhotoEditor

Every tool runs in your browser. Your photos never leave your device — see how that works.

Compress a JPEG to an Exact KB Size

Type a number - 20 KB, 50 KB, 100 KB - and this tool binary-searches JPEG quality until your photo lands just under it. Built for exam portals and government forms with hard limits. It costs nothing, and because every pass runs locally, your document photos stay on your own device.

Loading the tool…

How it works

  1. Drop the JPEG (or any photo) into the box at the top.
  2. Enter your target size in KB, or tap a preset like 20, 50 or 100.
  3. Wait a moment while the tool searches for the best quality under the limit.
  4. Check the preview and the final size shown next to it.
  5. Download the result and submit it to your portal.

Worth knowing

Hitting an exact file size is a search problem, because JPEG encoders accept a quality number, not a byte count, and the relationship between the two depends entirely on image content. This tool runs a binary search across the quality range 20 to 95: encode at the midpoint, measure the bytes, then narrow the interval up or down. After about seven passes it converges on the highest quality that still fits under your number.

Sometimes even quality 20 overshoots the target. That happens when there are simply too many pixels for the byte budget - a 4000-pixel-wide portrait cannot become 20 KB at any quality worth looking at. When the search bottoms out, the tool enters downscale rounds: dimensions shrink by a factor of 0.9 and the quality search repeats, looping until the target is met. You end up with the largest dimensions and best quality the byte limit physically allows.

Application portals are the main reason this page exists. Recruitment sites commonly demand a photo between 20 and 50 KB and a signature between 10 and 20 KB, and they reject anything outside the window - sometimes including files whose pixel dimensions are wrong. Read your portal instructions for both constraints, set the pixel size first if one is specified, then let the KB search handle the rest.

One caution about aiming absurdly low: ID cards and documents lose legibility faster than faces do, because compression attacks exactly the sharp strokes that letters are made of. If a form accepts a range, target the top of it rather than the bottom - a 48 KB photo under a 50 KB cap looks dramatically better than a 21 KB one and passes the same check.

The quality search converges in at most seven encoding passes, because binary-searching the 20-95 range takes ceil(log2(76)) = 7 steps - which is why results appear in about a second rather than after dozens of attempts.

Verify it yourself: open your browser's DevTools, switch to the Network tab, and use this tool — you will see no upload request. Or load the page, go offline, and it still works.

What this tool will not do

  • It will not make a 20 KB target achievable at 4000 px - physics wins; the tool has to downscale in 0.9x rounds until the budget fits.
  • It will not pad a file upward to meet a minimum size requirement; it only compresses toward a maximum.
  • It will not preserve PNG transparency - output is JPEG, so transparent areas become a solid background.

Commonly published photo upload limits (always confirm the current rules on your portal before submitting)

Portal / use caseTypical photo limitTypical dimensions
SSC (India) application photo20-50 KB3.5 x 4.5 cm scan
UPSC application photo20-300 KB350x350 to 1000x1000 px
IBPS / bank recruitment photo20-50 KB200x230 px
IBPS / bank recruitment signature10-20 KB140x60 px
US DV lottery (green card) photomax 240 KB600x600 px exactly
Generic job portal / CV photounder 200 KBvaries
Email-friendly single photounder 500 KBvaries

Questions people ask

How do I compress a JPEG to exactly 20 KB?

Enter 20 in the target box and drop your photo in. The tool searches quality settings first, and if the photo is too large in pixels it also reduces dimensions step by step until 20 KB is reachable. The output lands at or just under 20 KB, never over.

Why does my photo look bad at 20 KB but fine at 100 KB?

A byte budget is spread across every pixel. At 20 KB, a 1000x1000 image gets about 0.16 bits per pixel, which forces visible blocking. Either accept smaller dimensions or use the highest KB value your form allows.

The portal wants both exact pixels and a KB range. Which do I set first?

Pixels first, always. Resize to the required dimensions, then run the KB compression. Doing it in the other order can undo your byte target when the dimensions change.

Will the result be slightly under my target or exactly on it?

Slightly under. Portals enforce limits as a hard maximum, so the search stops at the largest file that does not exceed your number - typically within a few percent of it.

Can I compress a PNG or HEIC to a KB target with this?

You can drop one in, but the output will be JPEG, since predictable size control only works with a lossy format. If your portal explicitly requires PNG, check whether it also enforces a size cap - most portals that cap size accept JPEG.

Why did the tool shrink my image dimensions when I only asked for a size change?

Because your target was unreachable at the original dimensions even at minimum quality. The tool then reduces width and height by 10 percent per round until the target fits. The final dimensions are shown before you download.

Usually the next step

More in Compress & Optimize

This page processed nothing on any server — there is no server. The technical explanation.