Compression6 min read·Updated

How to Compress an Image to a Specific Size (20 KB to 1 MB)

To compress an image to a specific size, bring its pixel dimensions into range first, then lower the JPEG quality until the file fits. A photo saved at quality 70 takes roughly 0.6–1.2 bits per pixel, so 100 KB holds about 900 × 900 px and 50 KB about 630 × 630 px. A Target size tool does both steps for you: type the KB limit and it picks the highest quality that fits, shrinking the dimensions only if it has to.

Why can't quality alone get my image down to 50 KB?

A JPEG's size is roughly width × height × bits per pixel ÷ 8. The quality setting only changes the bits per pixel; the pixel count stays the same. A 4,000 × 3,000 phone photo has 12 million pixels, so even at a harsh 0.3 bits per pixel it still weighs about 450 KB. Reaching 50 KB would take 0.03 bits per pixel, far below the point where JPEG holds together: under roughly 0.3 bits per pixel you start to see 8 × 8 blocks, smeared color and halos around edges.

A quick check before you start: multiply your target in KB by 8,000 and divide by the number of pixels. Above about 1 bit per pixel, you can keep the dimensions at a comfortable quality. Between 0.3 and 1, lower the quality. Below 0.3, reduce the dimensions first, or the result will look broken.

How big is a JPEG at each size and quality?

Typical JPEG sizes for ordinary photos, estimated from about 0.6–1.2 bits per pixel at quality 70 (small images need more bits per pixel)

Dimensions (pixels)MegapixelsQuality 85Quality 70Quality 50
4,000 × 3,000 (phone camera)121.5–2.8 MB0.9–1.8 MB0.7–1.3 MB
2,048 × 1,5363.1400–750 KB240–470 KB180–330 KB
1,600 × 1,2001.9240–450 KB145–290 KB110–200 KB
1,200 × 1,2001.4180–340 KB110–220 KB80–150 KB
800 × 8000.6490–170 KB55–105 KB40–75 KB
600 × 6000.3655–105 KB35–70 KB25–50 KB
300 × 3000.0918–35 KB10–25 KB8–15 KB

Detailed scenes (foliage, gravel, crowds, noisy low-light shots) land at the top of each range or above it; plain backgrounds, studio portraits and products on white land at the bottom. Screenshots and flat graphics follow different rules: see why PNG files get so large.

What pixel size fits each target?

Turn the formula around to get a pixel budget. At about 1 bit per pixel, which is what quality 65–75 gives an ordinary photo, each KB buys roughly 8,000 pixels:

Largest dimensions that usually fit each target as a JPEG at quality 65–75

TargetPixel budget4:3 photoSquare
20 KBabout 160,000about 460 × 345about 400 × 400
50 KBabout 400,000about 730 × 550about 630 × 630
100 KBabout 800,000about 1,030 × 775about 900 × 900
200 KBabout 1.6 millionabout 1,460 × 1,100about 1,260 × 1,260
500 KBabout 4 millionabout 2,300 × 1,730about 2,000 × 2,000
1 MBabout 8 millionabout 3,260 × 2,450about 2,830 × 2,830

Busy photos need about 20% fewer pixels for the same target; ID photos on a plain background fit more. If the site also states a pixel size, use that and let the quality do the rest.

How do I compress an image to an exact size?

The Fast WebP Converter compressor has a Target size mode built for this. You type a maximum in KB; it searches for the highest quality that fits, and if the image is still too big at a low quality, it scales the dimensions down step by step until it fits. Everything runs in your browser, so the image is never uploaded, and it is free for a single image with nothing to install.

  1. Open the page for your target: 20 KB, 50 KB, 100 KB, 200 KB, 500 KB, 1 MB or 2 MB. Each one opens with Target size already set. For any other number, open the compressor, switch to Target size and type it.
  2. Drop your image. JPG, PNG and WebP work in every browser; HEIC photos from an iPhone open in Safari.
  3. Pick the output format. Same as original keeps JPG as JPG and PNG as PNG; choose JPG when a form only accepts JPEG, which is also the easiest way to hit a small target with a photo.
  4. If the site requires specific dimensions (for example 600 px wide), turn on Limit width and type the width, so the tool only has to adjust the quality.
  5. Compress, check the size shown for the result, and download.
Type the KB limit and the tool finds the best quality that fits.
Leave a small margin
Some sites count 1 KB as 1,000 bytes and others as 1,024. For a 50 KB limit, aim for 45–48 KB and the file passes either way. More on that in converting a photo from MB to KB.

Which format hits a small target best: JPG, PNG or WebP?

For photos, JPG: every form accepts it and it compresses photos well. WebP is typically 25–35% smaller than JPEG at the same visual quality, so it fits more pixels into the same KB, but check that the site accepts .webp files first (WebP vs JPEG). PNG is the hardest to squeeze: the compressor shrinks it by reducing it to a palette of up to 256 colors, which works well for logos, signatures on white paper and screenshots, and poorly for photos.

What if the site also sets a minimum size?

Some portals give a range, such as 20–50 KB, or a floor such as 54 KB. If your file comes out under the minimum, start again from the original and choose a target near the top of the range, or keep more pixels. Compressing an already small file again will not make it bigger: when the tool cannot improve a file in its own format, it keeps the original. The photo and signature guide walks through typical form requirements.

Put it into practice

Compress your images right now: keep the format or set a target size, free and privately in your browser.

Open the compressor

Frequently asked questions

A photo needs to be around 900 × 900 px (or 1,030 × 775 for a 4:3 photo) to fit 100 KB at a good quality. A target size tool lowers the quality first and scales down only if it has to. Forms check a maximum, so 95–99 KB is as good as exactly 100.

It has too many pixels. A 12-megapixel photo stays in the hundreds of KB even at very low quality, so reduce the dimensions; the tables above show how many pixels each target can hold.

Yes, but at the right pixel size the loss is invisible on screen: a 1,200 × 1,200 photo at 150–200 KB looks clean. Visible damage comes from forcing a large image into a tiny target without resizing it.

Yes. The PNG is reduced to a palette of up to 256 colors, which suits screenshots and graphics. For photos, saving as JPG or WebP reaches small targets with far better results.

Keep reading

Compression4 min read

Convert a photo MB to KB

1 MB is 1,024 KB (or 1,000). To turn a 3 MB photo into 500 KB or less, resize it to about 2,000 px, then save it as JPEG at quality 70–80. Examples inside.

Read more
Compression4 min read

Shrink file, keep dimensions

Keep the same width and height and still cut file size 30–80%: re-encode at quality 75–85, switch to JPEG or WebP, strip metadata, use a PNG palette.

Read more
Compression6 min read

JPEG quality settings

JPEG quality scales quantization tables; it is not a percentage. Use 70–85 for the web, and note that 80 in Photoshop, GIMP and Lightroom are not the same.

Read more