About Compress Image to a Target Size in KB
Upload forms for visas, job portals and exam registrations often refuse any photo over a fixed size, such as 20 KB, 50 KB or 200 KB. Enter that number and this tool finds the best image that fits: the highest quality under the limit at full size, and, if even the lowest quality you allow is still too big, the same search on a slightly smaller picture until it fits.
You choose JPEG or WebP, the lowest quality you will accept, and whether the dimensions may shrink. A KB is counted as 1,000 bytes, so the result also passes forms that count 1,024.
How it works
- The image is decoded in your browser and turned upright from its camera orientation; transparency becomes the background colour you choose for JPEG.
- It is first encoded at quality 100. If that is over the target, the tool tries your lowest allowed quality, then halves the range between them until it has the highest quality that fits.
- If even the lowest allowed quality is too big and shrinking is on, the width and height are reduced in proportion to how far over the target it was, and the quality search runs again.
- Every result is at or under the target. The file is named after the original with the target added, such as photo-50kb.jpg.
Questions
Why is my 50 KB result 49 KB and not exactly 50?
An encoder makes files in steps, one per quality level, so the tool picks the largest step that does not go over. It never goes over: being under is what an upload form checks.
Does a KB here mean 1,000 or 1,024 bytes?
1,000 bytes. A form that counts 1,024 allows slightly more, so a file made for 50 KB here passes either way.
Will it change the width and height of my photo?
Only when quality alone cannot reach the target, and only if "Shrink the dimensions if needed" is on. The proportions are always kept. Turn it off and the tool tells you the smallest size reached instead.
Why can I not choose PNG?
PNG is lossless and has no quality setting to lower, so it cannot be squeezed to a chosen size. JPEG works for every photo and every form; WebP is smaller still where the form accepts it.
Is my photo uploaded?
No. Decoding, every trial encode and the final file are all made in this browser tab, and nothing is sent over the network.
How large an image can I use?
Files up to 200 MB, and as many pixels as your browser can draw (about 16 megapixels on iPhones). Very large photos take a few seconds, because every try is a full encode.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.