Compress image to a target size
Shrink a photo down to a maximum size you choose, handy when a site asks for an "image under 200 KB". Everything runs in your browser.
JPG, PNG or WebP
How it works
The tool automatically finds the highest JPEG quality that fits the requested size. If even at the lowest quality the image is still too heavy, it also reduces the dimensions until it fits, so you always get a file under the limit, at the best possible quality.
Why a maximum size is needed
Lots of sites, competitions, government portals, sign-up forms, online applications, cap the size of the photos you upload (often 100, 200 KB or 1 MB). With this tool you stay under the limit without having to guess the right quality by trial and error.
Why an exact size is not calculated, it is searched for
There is no formula that, given a size, returns the JPEG quality to use: how much a file weighs depends on how complicated the image is. A photo of a white wall at quality 90 weighs less than a photo of a wood at quality 50, because the wood is full of detail and the wall is not.
The only reliable way is therefore to try: compress, weigh, adjust and try again, narrowing the range each time. It is the same procedure used to guess a number between one and a hundred by asking «higher or lower», and in a few attempts it lands very close to the target.
When quality is no longer enough
If even at minimum quality the file stays above the limit, there is nothing left to squeeze: it means the image has too many pixels for that size. At that point the only route is reducing dimensions, and it is worth knowing because it is the choice that saves the result: a 4000-pixel photo at quality 10 is an illegible mosaic, the same photo reduced to 1200 pixels at quality 70 is perfectly presentable.
The general rule is that cutting pixels costs less visible quality than pushing compression. Halving width and height removes three quarters of the size and, on a photo destined for a screen or a form, is hardly ever noticed.
The typical limits of online forms
The thresholds actually met are few and recurring: 100 or 200 kilobytes for a passport photo or an attachment on a public portal, 1 or 2 megabytes for an advert or a general upload, 5 megabytes for the attachments of many applications. When a form does not state the limit, staying under half a megabyte nearly always avoids trouble.
Watch two details that make apparently fine uploads fail: some forms count kibibytes (1,024 bytes) rather than kilobytes, so it is wise to leave a five per cent margin; and many also impose a limit in pixels, which size alone does not guarantee.
What to check before uploading
That the image is still legible for its purpose: a photographed document has to stay readable character by character, and heavy compression is merciless there. If the file is for a passport photo or a document, look at it at one hundred per cent and not as a thumbnail.
And that it is still in the accepted format: some forms reject PNG, others reject anything that is not JPG, and a file renamed by hand does not change format. If the upload fails without explanation, format and pixel limit are the two suspects to check first.
Nearby tools
For compression by eye there is Compress image, for dimensions Resize photo and for format Convert image. For an ID photo there is Passport photo, and to see what a file weighs and measures Photo dimensions and info.