Skip to content

Compress image to a size in KB

Enter the size a form asks for and get a JPG that fits it.

Updated

How to compress an image to a size in KB

  1. Drop a JPG, PNG, WebP, AVIF, GIF or iPhone HEIC photo into the box above, or choose a file.
  2. Type the largest size the form allows in Maximum (KB), or pick one of the common sizes.
  3. If the form also sets a lower limit, type it in Minimum (KB).
  4. Check the new size, quality and dimensions in the result, then select Download.

How it works

Forms say “KB” but rarely say whether they mean 1,000 or 1,024 bytes. The tool takes the stricter reading of each limit: the maximum counts 1,000 bytes per KB and the minimum counts 1,024. A 50 KB maximum means at most 50,000 bytes, so the file is inside the range whichever way the site counts.

  1. Decode once. Your browser's own decoder reads the image and turns sideways phone photos upright using their EXIF orientation. iPhone HEIC photos go through a separate HEIC decoder. Transparent areas are filled with white, because JPG can't store transparency.
  2. Find a size that can fit. The image is saved as a JPG at quality 40, the lowest the tool will go before blocky artefacts show. If that is still over the maximum, the width and height shrink, keeping the shape. File size grows roughly with the number of pixels, so each side is scaled by the square root of how far over the file is, with a little margin, and the tool tries again.
  3. Find the highest quality that fits. A binary search between quality 40 and 95 finds the highest quality still under the maximum, in six encodes or fewer. When the quality-40 file is an eighth of the limit or less, quality 95 is tried first, which usually ends the search straight away.
  4. Reach the minimum, if you set one. If the best file is still under your minimum, the tool tries quality 100, then adds JPEG comment segments filled with spaces. Comments are part of the JPEG format and every viewer skips them, so the picture doesn't change; only the byte count does.

Every JPG is encoded by MozJPEG, the encoder Google's Squoosh also uses, compiled to WebAssembly and run in a background thread so the page stays responsive. When the image has to shrink, it's resampled with a Lanczos3 filter in linear light, which keeps edges crisp. The file is built from the pixels alone, so it carries no EXIF, GPS or camera details, and the same image with the same limits always gives the same file.

What fits in each size

Rough pixel sizes a typical photo can keep at good quality. Plain backgrounds fit more; busy detail fits less.

LimitTypical pixelsOften asked for
20 KBAbout 300×400 pxSignatures, small form photos
50 KBAbout 500×650 pxExam and job application photos
100 KBAbout 1000×750 pxDocuments, profile photos, web images
200 KBAbout 1400×1050 pxCertificates, listing photos
500 KBAbout 2000×1500 pxDetailed photos, small prints

Common uses

  • A form says “maximum 100 KB”. Job portals, scholarship sites and government services often reject anything bigger. Type 100, open the photo and download a JPG that fits, at the best quality the limit allows.
  • A portal needs a size range. Some sites want a file between two sizes, such as 20 and 50 KB. Enter both numbers and the tool lands inside the range, raising quality if the photo would otherwise be too small.
  • iPhone photo for an upload. HEIC photos from an iPhone are large and many sites won't take them. Open the HEIC directly and you get a JPG under the size you typed, ready to upload.
  • Attachment limits on older systems. Some intranets, ticket systems and email gateways still cap attachments at a few hundred kilobytes. Set the cap once and every photo you open comes out under it.

From the blog

Questions

How do I reduce a photo to a specific size in KB?

Open the photo, type the maximum the form allows in the Maximum (KB) box, and download. The tool tries qualities from high to low and keeps the highest one whose file fits, so you don't have to guess with a slider.

Why does the tool use a range instead of an exact number of KB?

A JPG's size depends on what's in the picture, so no setting produces exactly 50 KB. What forms check is that the file is under a maximum, and sometimes over a minimum. The result always lands inside the range you enter.

Does 1 KB mean 1000 or 1024 bytes?

Forms rarely say, and both are used. To be safe either way, the maximum is counted as 1000 bytes per KB and the minimum as 1024, so a file made for “20–50 KB” passes whichever one the site checks.

Will the photo get smaller in pixels?

Only if it has to. Quality is lowered first. If even a low quality is still too big, the width and height are reduced step by step, keeping the shape, and the result tells you the new dimensions.

What happens if my photo is already smaller than the minimum?

The tool saves it at the highest quality. If that is still under the minimum, it adds blank filler data that image viewers ignore, so the file reaches the size the form wants and the picture stays exactly the same.

All image tools →