Compress Image to a Target Size

Pick a size limit such as 20, 50, 100 or 200 KB and get a JPG that fits under it at the highest quality that will. The tool lowers quality first and reduces the dimensions only if it must, and it counts a kilobyte as 1000 bytes, so the file passes however a form measures. Runs in your browser.

Last updated

Max size
Up to 5 images per batch

How to compress an image to a specific size

01

Set the size limit

Pick 20, 50, 100, 200 or 500 KB, or type any limit from 10 to 5000 KB. You can set it before or after adding images.

Tip: Use the exact number the form gives. The tool aims under it counting a kilobyte as 1000 bytes, which also satisfies forms that count 1024.
02

Add up to five images

PNG, JPG, WebP and SVG are accepted, up to 25 MB each. Every image is fitted to the limit on its own, so one batch can mix large and small files.

Tip: If the form also gives dimensions in pixels, crop or resize to those first and compress afterwards. Fewer pixels leave more of the budget for quality.
03

Process and download

Each image is compressed in turn and the results download as JPG, in a ZIP if there are several. Every file comes in under the limit, or its card explains why it could not.

Tip: Open the result before uploading it. At very small limits the dimensions will have been reduced, so check the photo is still clear enough for its purpose.

What this image compressor does

Never over the limit

Every attempt is measured and only kept if it is at or below the limit. If an image cannot fit without shrinking below 160 pixels, you get a clear message instead of a file the form will reject.

Quality first, size last

Quality is searched before the image is resized at all, so a photo keeps its full dimensions whenever the budget allows it.

Kilobytes counted safely

Upload forms disagree about whether a kilobyte is 1000 or 1024 bytes. Aiming under 1000 bytes per kilobyte passes both kinds of check.

JPG with a white background

Output is JPG, the format size-limited forms ask for. Transparent areas in a PNG are filled with white rather than turning black.

Location data removed

The JPG is written from scratch, so EXIF metadata from the original, including the GPS position a phone may have recorded, is not carried across.

Nothing is uploaded

The search runs in a background worker in your browser, encoding the image as many times as it takes. Your photo never leaves your device.

Frequently Asked Questions

How do I compress a JPG to 100 KB?+
Select 100 KB as the maximum size, add the photo and press Process. The tool searches for the highest quality that comes in under 100 KB and keeps the photo at full size if it can; it only reduces the dimensions when quality alone cannot get there.
How much will my photo be reduced?+
It depends on how much detail the photo holds. In our tests on a busy, photo-like 1200 × 900 image, a 100 KB limit kept it at full size, 50 KB brought it to 723 × 542 and 20 KB to 457 × 343. A 4000 × 3000 version, the size of a typical phone photo, came out at 1933 × 1450 for 100 KB. Plainer pictures keep more of their size.
Why is the output a JPG and not a PNG?+
Because forms with size limits nearly always ask for JPG, and because only a lossy format can be tuned to fit an arbitrary limit. A PNG's size is fixed by its content, and the only way to make one smaller is to remove pixels.
Can the file get bigger?+
It can, slightly. An image that already fits is re-saved at quality 92, which may come out larger than a heavily compressed original, though always under your limit. If your file already fits the form, you do not need this tool at all.
What is the smallest limit it can reach?+
Any limit from 10 KB upwards, as long as the result can stay at least 160 pixels across. A detailed photo at 10 KB will be small; a simple graphic can stay much larger. If a limit cannot be met, the image card says so, and a slightly higher limit usually works.
Is my photo uploaded anywhere?+
No. Every encode happens inside your browser, in a background worker. You can confirm it in the developer tools: watch the Network tab while you compress, and no request carries your photo.

Format Comparison

Feature Specificationtarget-size compressionAlternative
Hits a size limitAlways, or says it cannotBy trial and error
Keeps full dimensions when possibleYes, quality is lowered firstYes
Output formatJPGWhatever you choose
Kilobyte definition1000 bytes, safe for bothNot applicable
MetadataRemovedDepends on the tool

Technical Overview & Specifications

Deep dive into target-size compression architecture and processing.

Show Details

Platform Overview

Size limits on upload forms are rarely explained and never negotiable. A university application wants a photo under 50 KB, an exam portal wants a signature under 20 KB, a job site turns away anything over 200 KB, and the message when you miss is usually just that the file is too large. Most people get there by guessing a quality setting in an editor, checking the file size, and trying again. This page does the guessing for you: you give it the limit, and it finds the best-looking JPG that fits under it.

It works in a fixed order. First it tries a high quality, and keeps that if it already fits. If not, it searches between quality 92 and quality 50, halving the gap six times, for the highest setting that fits. Quality goes before anything else because a full-size photo at moderate quality looks better than a shrunken one at high quality. Only if quality 50 is still too large does it reduce the dimensions, by just enough to fit, and it stops rather than hand back an image less than 160 pixels across. The result is always a JPG, with any transparency filled white and metadata such as GPS location removed. Up to five images, each fitted separately, all in your browser.

How the size search works

Encoded file size cannot be worked out in advance, because it depends on what is in the picture: a photo of foliage and a plain wall of the same dimensions can differ in size tenfold. So the tool measures, by encoding. For any one image, file size rises steadily with the quality setting, which is what makes a binary search valid: encode at the midpoint, keep the upper half if the file fits and the lower half if it does not, and repeat. Six rounds narrow the answer to within about a sixtieth of the range between quality 50 and 92, close enough that the next step up would break the limit.

When even quality 50 is too large, the image has more pixels than the budget can pay for. JPG size grows roughly in proportion to pixel count, so the tool takes the square root of the ratio between the budget and the sizes it has measured, aims at a middle quality rather than the floor, shrinks by that factor with a small safety margin, and runs the quality search again at the new size. Every attempt is drawn onto a white background first, because JPG has no transparency. The whole loop runs in a background Web Worker so the page stays responsive, and the number of attempts is capped so that a difficult image ends with a message rather than spinning.