Compress an image to a specific size in KB
Enter the largest file size a form accepts; the tool finds the highest quality that fits. Your browser does the work on your device; the pictures are not uploaded to our servers.
Your files are processed in this browser. They are not uploaded to our servers.
No files selected yet.
JPG, PNG or WebP, up to 50 MB each. You can also drop images here.
Choose files and start. The result appears here.
Something went wrong. Your entries are still here.
What this tool does
Application, exam and job forms often accept photos and scans only up to a fixed size, such as 20 KB, 50 KB or 100 KB. This tool writes each picture again as JPG or WebP and searches for the highest quality at which the file is no larger than the size you enter. If even a low quality is too large, it also reduces the number of pixels.
The result is never larger than the target. The list shows for every file the exact number of bytes, the quality that was used and the pixel size, so you can check the result before you upload it.
How to use it
- Choose the pictures, or drop them on the marked area. JPG, PNG and WebP are accepted.
- Enter the target size in KB, or press one of the common targets: 20 KB, 50 KB, 100 KB, 200 KB or 1 MB.
- Choose the output format. JPG is preselected because nearly every form accepts it.
- Start. Each picture is encoded several times; the list shows the size, quality and pixel size of the result.
- Download single files from the list, or all of them as one ZIP archive.
How the target size is reached
A limit of 100 KB means 100,000 bytes to some programs and 102,400 bytes (100 × 1,024) to others. The tool counts 1 KB as 1,000 bytes and 1 MB as 1,000 KB, the stricter of the two readings, so the file passes both kinds of check.
- Quality: the tool tries quality values between 40 and 95 by halving the range each time (binary search). A result that fits raises the lower end, a result that is too large lowers the upper end. After at most six encodings it knows the highest quality that fits.
- Pixels: if quality 40 is still too large, both sides are multiplied by 0.9 × √(target ÷ size at quality 40), at most by 0.9, and the quality search starts again. The file size of a photo roughly follows its number of pixels, which is why the square root is used; the factor 0.9 leaves a margin.
- Guarantee: only files that were actually encoded and measured are returned, so a result is never larger than the target. If the longer side would fall below 16 pixels, the tool stops and says that the target is too small.
Quality 40 as the lowest value is a convention of this tool, not a standard: below it, the 8 × 8 pixel blocks of JPEG become easy to see, and a picture with fewer pixels at a moderate quality usually looks better.
A picture that already has the chosen format and is within the target is returned unchanged. Every other result is written from the pixels only; camera data such as the GPS position is not copied.
Worked example
A camera photo of 4288 × 2848 pixels (12.2 megapixels) and 1,896,240 bytes should go through a form that accepts at most 100 KB. In Chrome, the quality search at full size tried 67, 53, 46, 42 and 40. All were too large; quality 40 gave 348,825 bytes.
The sides were multiplied by 0.9 × √(100,000 ÷ 348,825) ≈ 0.48, giving 2066 × 1372 pixels, but quality 40 still gave 123,898 bytes: smaller pictures need more bytes per pixel. The next factor, 0.9 × √(100,000 ÷ 123,898) ≈ 0.81, gave 1670 × 1109 pixels. There the search tried 67, 53, 46, 42, 44 and 45, and quality 45 gave 99,406 bytes, within the limit. That took 16 encodings and less than a second on a laptop.
With WebKit, the engine of Safari, the same photo ended at 1311 × 871 pixels, quality 43 and 99,301 bytes, because its encoder works differently. With a target of 500 KB, Chrome kept all pixels at quality 61 (499,818 bytes).
Common mistakes
- Compressing the result again for a smaller target. Every lossy save removes detail; start again from the original picture.
- Forgetting a pixel requirement. Some forms ask for both a file size and a pixel size, such as 200 × 230 pixels. Crop or resize first, then compress to the target size.
- Choosing a very small target for a whole photo. At 20 KB, the photo of the example above ends up with 526 × 350 pixels. For a portrait, crop to the face first, so that the pixels go where they matter.
- Expecting transparency to survive. JPG cannot store transparent areas; they become white.
Frequently asked questions
- Why is my file smaller than the target, not exactly 100 KB?
- Quality moves in whole steps. The tool keeps the highest step that fits; the next step up was already larger than the target. The gap is usually a few percent.
- Does 100 KB mean 100,000 or 102,400 bytes?
- Both readings are in use. The tool aims at 100,000 bytes, so the result also passes a check that allows 102,400. The list shows the exact number of bytes of each result.
- Why did the pixel size of my picture change?
- Even at quality 40 the file was larger than the target, so the tool reduced the width and height in the same proportion. The list shows the new and the original pixel size. A larger target keeps more pixels.
- Can I compress a PNG to a specific size?
- Yes, but the result is a JPG or WebP file. PNG stores pixels without loss and has no quality setting, so its size cannot be tuned. Transparent areas become white in a JPG.
- Are my pictures uploaded during the search?
- No. Every trial encoding is made and measured by your browser on your device, and the code of this site does not send the pictures to our servers or anywhere else. When advertising is enabled and permitted, the page also loads third-party advertising scripts; the privacy policy explains this.
Last updated: September 29, 2026