Compress an Image to an Exact Size

Give it a size budget — under 1 MB, 500 KB, whatever the form demands — and it finds the highest quality that still fits, rather than making you guess at a slider.

100% private — your image never leaves this device. Every trial encode happens on a canvas in this page. The image is never uploaded, which matters when the form you are fighting is a passport or visa application.
Drop images here, or click to browse
Several at once · or paste from the clipboard
JPG · PNG · WebP · GIF · HEIC · RAW · TIFF · PSD and more
About this exact-size image compressor

This compressor works backwards from the number you actually care about. You say the file must come in under 1 MB — or 500 KB, or 200 KB — and it searches for the highest quality setting that still fits, instead of leaving you to drag a slider and re-check the file size.

Upload forms are where this bites. A visa portal wants the photo under 200 KB, a job board caps the CV scan at 2 MB, a marketplace rejects anything over 1 MB, and an email bounces at 25 MB. A normal compressor gives you a quality slider and no idea which setting produces which size, so you guess, export, check, and guess again. Here the guessing is the tool's job: it encodes the image repeatedly, narrowing in on the answer by halving the range each time, and settles on the setting that produces the largest file still under your limit. Largest is the point — the closer to the budget, the less was thrown away.

Quality is always spent before pixels. Dropping the JPEG quality from 95 to 80 usually halves the file and is invisible on a screen; shrinking a 4000-pixel photo to 1200 is visible the moment anyone zooms in. So the search exhausts the quality range first, down to the floor you set, and only then starts reducing dimensions — and it tells you plainly when it had to, and by how much.

Transparency is respected throughout. If an image has transparent areas the tool will not silently hand you a JPEG with a white block behind the logo; it stays on formats that can carry an alpha channel, and says so on the result row.

Every trial encode runs on your own device through the browser's canvas, so a passport scan or a confidential contract never leaves your machine — and since the tool reports the exact final size and quality, you can prove the result meets the limit before you upload it.

How to use
  1. Drop in one or more images, or paste one from the clipboard.
  2. Pick the size budget — 100 KB through 2 MB, or type your own number in KB or MB.
  3. Choose a format, or leave it on Auto to let the tool pick whichever lands closest under the limit.
  4. Decide whether shrinking the pixel dimensions is allowed if quality alone cannot get there, and set the quality floor.
  5. Watch the preview: it compresses the selected image for real as you change the settings, and the line underneath gives the exact before and after size, the quality it settled on and whether the image had to be shrunk. Drag the vertical line across to compare against the original.
  6. Download that one image, or apply the same budget to every image you loaded and download the batch as a ZIP.
FAQ

Yes. As well as JPEG, PNG, WebP, GIF, BMP, ICO and AVIF, this tool reads HEIC and HEIF from a phone, TIFF, Photoshop PSD and PSB, TGA, Netpbm, Apple ICNS, and camera RAW from every major brand — CR2, CR3, NEF, ARW, DNG, ORF, RAF, RW2 and the rest. Anything the browser cannot open by itself is decoded on your own device before the tool touches it.

It encodes the image several times. Each attempt tells it whether the current quality setting is above or below your budget, and it halves the remaining range each round — around eight attempts is enough to land within a fraction of a percent of the best possible setting. That is too tedious to do by hand, which is why most tools just give you a slider.

Some, unavoidably — a smaller file holds less information. The point of this tool is that it loses the least possible for the size you asked for, by keeping the highest quality that fits rather than a safe guess well below it. At 1 MB most phone photos come out visually identical to the original on screen.

If even the lowest quality and the smallest size cannot reach your number, you still get the smallest file the tool could produce, and the result row says clearly that the budget was missed and by how much. It never silently hands back something over the limit.

Yes. Auto never picks JPEG for an image with transparency, because JPEG cannot store it — it uses WebP or PNG instead. If you force JPEG yourself the row warns you that the clear areas will come out white.

PNG is lossless, so there is no quality dial to turn — the only lever left is the pixel dimensions. For a photograph, switching to JPEG or WebP will cut the size by an order of magnitude at the same apparent quality. Keep PNG only for logos, screenshots and anything with transparency or hard edges.

No. The preview compresses the selected image for real, every time you change the budget, the format or the quality floor, and shows the actual decoded file next to the original with a slider between them. The figure under it is the true final size, not an estimate. The Apply button is only there for running the same budget across the rest of the batch.

This tool treats 1 MB as 1,048,576 bytes, the stricter of the two readings. Most upload forms measure the same way, so a file that fits here will fit there. If a form is unusually literal about 1,000,000 bytes, use the custom field and type 976 KB.

Yes. Drop in as many images as you like, set the budget once, and every file is squeezed to the same target independently. Each result shows its own before and after size, and Download all saves the batch as a single ZIP.