ExactImage

Compress a photo to an exact file size

Name a target — 20 KB, 50 KB, whatever the form demands — and get a file just under it. Your photo never leaves your device.

Drop an image here, or click to choose one

You can also paste a screenshot with Ctrl+V. JPG, PNG, WebP.

Target file size
Network measuring… Your file never leaves this device

Every byte of that work happened on your own machine. Verify it: open DevTools → Network, and use the tool. No request carries your image, because none is made.

Why "under 100 KB" is such a specific kind of misery

Almost nobody wants to compress an image for its own sake. They want to compress it because a form will not accept it: a government portal capped at 50 KB, a job application that wants a photo under 200 KB, a forum with a 1 MB ceiling, a CMS that silently rejects anything larger. The requirement is a hard number, and most tools do not let you name a number. They give you a quality slider and leave you to guess, upload, get rejected, and guess again.

This tool inverts that. You give it the number; it finds the settings. Internally it bisects the encoder's quality range to find the largest setting whose output still fits, and if that is not enough it reduces the pixel dimensions and searches again — so you get the best-looking image that satisfies the constraint, rather than the first one that happens to squeak under.

The privacy problem nobody mentions

The images people most often need to compress are the ones they should be least willing to hand to a stranger: passport photographs, signatures, scans of identity documents, medical forms, photographs of children for school portals. The standard compression sites upload all of it to a server, process it there, and send it back. Their privacy policies vary in how long they claim to keep it.

There is no reason for any of that. Browsers have been able to decode, resize and re-encode images locally for over a decade. This site does the work in the tab you already have open — which is not only more private but faster, because a 4 MB photo never has to make a round trip over your connection before anything happens.

The honest version of a privacy claim is a falsifiable one. Open your browser's developer tools, go to the Network tab, and compress an image. You will see this page's own files load and then silence. That is the whole guarantee, and you can check it in ten seconds.

Questions

How does it hit an exact file size?
JPEG encoders take a quality setting, not a size, and the relationship between the two is different for every image — a photo of a blank wall compresses far harder than a photo of a forest. So the tool searches: it encodes your image repeatedly at different quality settings, bisecting toward the largest setting that still fits under your target. If even the lowest usable quality overshoots, it steps the pixel dimensions down and searches again. That whole search runs on your own CPU in a fraction of a second.
Is my photo uploaded anywhere?
No, and not as a policy — as an architecture. This site has no upload endpoint and no server that could receive your file. Your browser reads the image from your disk, your CPU re-encodes it, and the result is written back to your downloads folder. Open DevTools and watch the Network tab if you want to see the absence of any request for yourself.
Why is the result slightly under my target rather than exactly on it?
Because going over is a failure and going under is not. Upload forms reject anything above the limit, so the tool always lands just below it — typically within a percent or two. If you asked for 20 KB you will get something like 19.6 KB, which every portal accepts.
Why does the quality drop so much at very small targets?
There is a floor to how much information can survive in 20 KB. A 12-megapixel phone photo carries several million pixels; squeezing that into 20 KB means roughly one byte per six hundred pixels. The tool protects the result by shrinking dimensions rather than pushing quality into mush, because a sharp small image beats a blurry large one at every file size.
What about PNG?
PNG is lossless, which means it has no quality dial to turn — you cannot compress a PNG to an arbitrary size without changing its pixel dimensions or its colour count. For an exact size target, JPEG or WebP is the right format, and the tool converts for you. PNG is offered on the resize page where lossless output makes sense.
Does it strip EXIF and location data?
Yes, as a side effect of re-encoding. The output is written fresh from the pixels, so the camera model, timestamp and any GPS coordinates in the original are not carried across. If you are compressing a photo before posting it publicly, that is a useful thing to know.