CompressToSize

Compress image to a specific size

Pick the ceiling you have been given. Each page below opens the compressor with that target already set.

Private by design. Your images are compressed inside this browser tab. Nothing is uploaded to any server.
Drop images here or click to choose · you can also paste with Ctrl+V JPG, PNG and WebP · as many as you like

Ad

Every target, with what it costs you

The table lists every target, the exact byte count it corresponds to, and the rough pixel budget a typical photograph has at that size. Use it to sanity check a limit before you fight with it: if a form wants 20KB and you are trying to send a twelve megapixel photo, no encoder is going to make that look good, and the real answer is to resize first.

TargetBytesComfortable resolutionBest format
10KB10,240 bytes~360 × 240JPG
15KB15,360 bytes~440 × 290JPG
20KB20,480 bytes~510 × 340JPG
25KB25,600 bytes~570 × 380JPG
30KB30,720 bytes~620 × 410JPG
40KB40,960 bytes~720 × 480JPG
50KB51,200 bytes~800 × 530JPG
100KB102,400 bytes~1130 × 750JPG
150KB153,600 bytes~1390 × 920JPG or WebP
180KB184,320 bytes~1520 × 1010JPG or WebP
200KB204,800 bytes~1600 × 1070JPG or WebP
250KB256,000 bytes~1790 × 1190JPG or WebP
300KB307,200 bytes~1960 × 1310JPG or WebP
500KB512,000 bytes~2530 × 1690JPG or WebP
1MB1,048,576 bytes~3620 × 2410WebP or PNG
2MB2,097,152 bytes~5120 × 3410WebP or PNG
5MB5,242,880 bytes~8100 × 5400WebP or PNG
8MB8,388,608 bytes~10240 × 6830WebP or PNG
10MB10,485,760 bytes~11450 × 7630WebP or PNG
20MB20,971,520 bytes~16190 × 10790WebP or PNG
25MB26,214,400 bytes~18100 × 12070WebP or PNG

Kilobyte here means 1024 bytes, which is what upload validators almost always mean too. A form that says "maximum 100KB" is nearly always checking against 102,400 bytes rather than 100,000. Where a system does use the decimal definition the difference is under two and a half percent, comfortably inside the margin you should be leaving anyway.

Why compress to a specific size at all

Because the systems that impose these limits do not negotiate. A visa portal that wants 200KB rejects 201KB without telling you which field was wrong. A recruitment site that wants 100KB silently truncates the upload. The number is the requirement, and a quality slider that leaves you guessing how many kilobytes you will get is the wrong instrument for meeting it. The instrument you want lets you compress image to a specific size and tells you the byte count it actually reached.

Working backwards from the number is also simply more efficient. Rather than exporting at quality 80, checking, exporting at 60, checking again, and eventually settling for something well under the limit because you got tired of iterating, the search converges in under a second and lands as close to the ceiling as it can. Closer to the ceiling means more of your detail survives.

The targets below are not arbitrary either. Each one is a limit that real systems actually enforce — identity document portals cluster around 20KB to 200KB, job boards and CMS uploaders around 1MB to 5MB, chat apps between 8MB and 25MB. Starting from the number you were given and working down is faster than starting from your file and hoping. Pick the closest target, compress image to a specific size, and check the result against whatever gave you the limit in the first place.

Every file stays on your device

Nothing you drop onto this page leaves your device. The image is decoded, re-encoded and handed back entirely inside the browser tab. There is no upload, no queue, and no temporary copy sitting on someone else's disk waiting for a retention policy to delete it.

That matters more than it sounds. The files people most often need to shrink are the ones they should be most careful with: passport scans, signatures, identity documents, medical forms. Handing those to an unknown server in exchange for a smaller file is a poor trade. Because the work is local, you can compress image to a specific size with the network disconnected and get the same result.

It also means there is no queue to wait in and no daily allowance to run out of. Server-side compressors have to ration free use because every file costs them CPU time; here the CPU is yours, so you can compress image to a specific size as many times as you like, on as many files as you like, without an account.

Frequently asked questions

Which target should I choose?
Whichever number the form in front of you specifies, minus a small margin. If nothing specifies one, 200KB is a good default for anything going on a web page and 1MB for anything going into email.
Is KB 1000 or 1024 bytes here?
This tool uses 1024, matching what upload validators overwhelmingly use. The gap is under 2.5%, well within the margin you should leave anyway.
Do you support PDF or video?
Not yet. Both need decoding that browsers do not expose natively, and shipping something that half works would be worse than not shipping it. Images in JPG, PNG and WebP are handled fully.
Ad

All size targets