All tools
Compress & Optimize

Compress Image to a Target Size

Set a size limit, such as 100 KB or 2 MB, and the tool finds the highest quality that fits. Ideal for forms and portals with strict upload limits.

Drop an image here or click to browse

JPG, PNG, WebP, GIF, BMP, TIFF, AVIF, HEIC or SVG · 1 file · 100 MB each

Hit an exact file size limit

Application forms, visa portals, school platforms and marketplaces often reject images above a fixed size. Guessing quality settings until a file squeezes under the limit is tedious, and most tools either overshoot or compress far more than necessary.

This tool searches for the best quality automatically. It decodes the image once, then tries up to eight quality levels in a binary search, always keeping the largest result that still fits under your target. The image keeps its original width and height; only the compression changes.

How to compress an image to a specific size

  1. Step 1: Drop in one image

    JPG, PNG and WebP work best. Other formats are compressed as JPEG.

  2. Step 2: Choose a target

    Pick 50 KB, 100 KB, 200 KB, 500 KB, 1 MB or 2 MB, or type any custom size in KB. Presets larger than your file are disabled.

  3. Step 3: Compress

    Watch the attempts counter while the tool searches for the right quality.

  4. Step 4: Check and download

    Compare the original, result and target sizes, then download the file.

How the size search works

Binary search over quality

Up to eight encodes zero in on the highest quality under your limit.

Original dimensions kept

The image is never resized, so it stays sharp at its original size.

Format kept

JPG stays JPG, PNG stays PNG and WebP stays WebP; other formats become JPEG.

Custom targets

Any whole number of kilobytes, from tiny thumbnails to multi-megabyte limits.

When you need a size target

  • Government and visa forms. Passport and ID photo uploads often cap files at a few hundred kilobytes.

  • Job and school portals. Profile pictures and scanned documents usually have strict limits.

  • Marketplaces and forums. Listings and avatars frequently reject large images.

  • Email signatures and newsletters. Small, predictable image sizes keep emails light.

When the target cannot be reached

Every image has a floor: below a certain size the encoder cannot go without changing the pixel dimensions. If your target is below that floor, the tool returns the smallest version it could produce, which may still be above the target. The result panel shows the final size next to the target so you can see this immediately.

In that case, reduce the dimensions first with the image resizer, for example to 1200 pixels wide, then run the target size tool again. Fewer pixels make small targets easy to reach with good quality.

PNG files and size targets

For PNG, quality controls how many colors the image keeps. Screenshots and graphics reach small targets without visible change, but a photo saved as PNG may need very few colors to fit, which shows as banding.

If a PNG photo has to meet a small limit, convert it to JPEG or WebP with the image format converter first. Photos compress far better in those formats.

  • Photos: use JPG or WebP for small targets.
  • Screenshots and logos: PNG works well.
  • Very small targets: resize first, then compress.

Tips for meeting size limits

  • Aim a little under the official limit, for example 190 KB for a 200 KB cap, to allow for how some sites count kilobytes.
  • Crop away empty background before compressing; fewer pixels need fewer bytes.
  • Check the photo requirements too: many forms also demand exact dimensions or a white background.
  • Keep the original; compress a fresh copy if you need a different target later.

Target file size FAQ

Will the result be exactly my target size?

It will be at or below the target whenever that is possible, usually close to it, because the tool keeps the highest quality that fits.

Does it change the image dimensions?

No. Only compression quality changes. Resize first if you need smaller dimensions.

Can I enter a size in megabytes?

Use the 1 MB and 2 MB presets, or type the equivalent in kilobytes in the custom field, for example 1536 for 1.5 MB.

What if my target is too small?

You get the smallest version the tool could make. Reduce the dimensions with the resizer and try again.

Which formats are supported?

JPG, PNG and WebP keep their format. GIF, BMP, TIFF, AVIF, HEIC and SVG inputs are compressed as JPEG.

Is the image uploaded?

No. The whole search runs in your browser.

Related image tools