CompressPictureA PictureEditor.com tool
Every re-encode happens on this device. No file is posted anywhere.

Compress an image to a size in KB

Type the cap the form gave you. Eight encodes at most, in a worker, and the largest file that fits underneath it — or a straight answer that the format cannot get there.

Drop up to 100 images. Nothing is re-encoded until you set a quality or a target size.Click, press Enter, or paste from the clipboard. 120 MB a file, JPG PNG WebP GIF BMP TIFF HEIC.

Nothing to hand?

Caps that keep coming up

Photograph and signature fields on recruitment and university forms usually sit in the 20 to 50 KB band and document fields in the 100 to 500 KB band. Each body publishes its own figures and changes them between cycles, so read the form rather than trusting this row.

50.0 KB — 51,200 bytes, counting a kilobyte as 1,024. Brackets [ and ] step this by 10 KB.

Nothing is re-encoded until a file is open and this button is pressed.

How the search finds the number

There is no formula that turns a byte target into a quality setting. The relationship depends on the picture: a photograph of a wall and a photograph of a forest at the same dimensions and the same quality differ by a factor of five. The only reliable way to hit a cap is to encode, measure and encode again.

  1. 1The first trial is the floor — JPEG quality 5, or a two-colour palette. If the floor is still over your cap, no setting on that axis will fit, and you are told so after a single encode.
  2. 2If the floor fits, it becomes the answer to fall back on and the search bisects upward, each trial taking the half of the range that is still worth looking at.
  3. 3For a PNG there is one extra trial before all of that: the lossless pass. If the file fits under the cap without a pixel changing, the search stops there, because nothing improves on that.
  4. 4The search stops after eight encodes or when the range closes, whichever comes first, and returns the largest file it found under the cap.

All of it runs in a worker. Eight full re-encodes of a twelve megapixel photograph on the main thread is a frozen tab; here the page keeps drawing and the trial list fills in as each one lands.

When the cap cannot be met

A cap is unreachable when the picture has more pixels than the cap has room for. Twenty kilobytes across four thousand by three thousand pixels works out at one byte for roughly every six hundred of them, and no JPEG encoder writes a photograph that thin without turning it into blocks.

At that point this page stops and tells you the smallest file it could make. The next step — reducing the long edge — changes the picture's dimensions rather than its bytes, so it happens only when you press the button that says so, and the dimensions it would produce are on the button. This tool never quietly makes a picture smaller to make a number look right.

The chroma and format steps are not in this build.

A fuller ladder would offer 4:2:0 chroma subsampling and a more efficient container before it ever suggested changing dimensions. The browser's JPEG writer does not expose subsampling, and WebP and AVIF encoders are not in this build, so the ladder here has two rungs: the honest floor, then a consented reduction of the long edge. Nothing is offered that this page cannot actually do.

Kilobytes, and which kilobyte

  • A kilobyte is counted as 1,024 bytes throughout this site, and the exact byte figure is printed beside the control.
  • Upload forms are inconsistent about this, so the stricter reading is used: a file under the cap at 1,024 bytes to the kilobyte is also under it at 1,000.
  • The size a form checks is the size on disk. It does not care what the picture looks like or what it once weighed, which is why the result here is the file itself rather than an estimate of one.

Questions people arrive with

Why is the result 18.6 KB when I asked for 20 KB?
Because file size moves in steps as quality moves, and the search returns the largest file that is still under your cap rather than one that is exactly on it. An upload form checks for at most 20 KB. A file at 18.6 KB passes that check; a file at 20.1 KB does not.
Is a kilobyte 1000 bytes or 1024 here?
1024. A 50 KB cap is treated as 51,200 bytes, and the exact byte figure is printed next to the control so there is no ambiguity. Portals differ on which they mean, and 1024 is the stricter reading of the two — a file that passes at 1024 bytes to the kilobyte also passes at 1000.
What happens when the cap cannot be reached?
The tool stops and reports the smallest file the format can produce at those dimensions, along with the setting that produced it. It then offers a reduction of the long edge as a separate step, with the dimensions it would produce shown before you agree. It will not quietly make the picture smaller to hit a number.
How many times does it encode my file?
Eight at most. The first trial is deliberately the format's floor, so a cap that is out of reach is reported after one encode instead of eight; if the floor fits, the remaining trials climb back up looking for the best setting that still fits. Every trial is listed with its size as it lands.
The form wants 20 KB and also a fixed pixel size. Which do I do first?
Pixel dimensions first, elsewhere, then the byte cap here. Setting the dimensions after the byte cap re-encodes the file and changes its size, which puts you back over the cap. The exam-portal guide works through the order in full.

Elsewhere on this site