What Compress Image to KB does
This tool shrinks a JPG, PNG or WebP until it fits a size limit you set in kilobytes. The default target is 100 KB, which is 102,400 bytes. It first lowers the encoder quality, checking the real size of each attempt, and only if quality 50 is still too large does it scale the pixel dimensions down. The result is reported with its exact byte count, its dimensions and the quality that was used, so you can see what the limit cost you. If no setting fits, the tool says so instead of handing you a file that is over. Everything runs in your browser and the image is not uploaded.
20 KB, 50 KB, 100 KB and 200 KB in bytes
The limit the tool enforces for each target, under both ways of counting a kilobyte. These are the figures shown beside Target in the result.
| Target | Bytes at 1,024 per KB | Bytes at 1,000 per KB |
|---|---|---|
| 10 KB | 10,240 | 10,000 |
| 20 KB | 20,480 | 20,000 |
| 30 KB | 30,720 | 30,000 |
| 50 KB | 51,200 | 50,000 |
| 100 KB | 102,400 | 100,000 |
| 150 KB | 153,600 | 150,000 |
| 200 KB | 204,800 | 200,000 |
| 300 KB | 307,200 | 300,000 |
| 500 KB | 512,000 | 500,000 |
| 1,024 KB (1 MB) | 1,048,576 | 1,024,000 |
Choosing 1,000 bytes per KB gives a file that passes under either definition, at the cost of about 2.3% of the size budget.
How the target size is reached
An encoder has a quality setting, not a size setting, so the size has to be found by encoding and measuring. The order below is what the tool does.
- If the file you chose is already at or under the limit, it is returned untouched. Re-compressing it would only lose quality.
- The image is encoded at its original dimensions at quality 50 and quality 95. If 95 fits, that is the result.
- Otherwise a binary search between 50 and 95 finds the highest quality whose real file size fits. That takes about eight encodes.
- If quality 50 is still too large, the dimensions are reduced. The new scale is estimated from how far over the file was, and the quality search runs again at that size. Width and height shrink together, so the shape never changes.
- If Keep the original pixel dimensions is ticked, step 4 is skipped and quality is searched from 49 down to 10 instead.
- The result is accepted only if its measured size is at or under the limit. Otherwise the smallest attempt is shown with a warning.
What the tool does in three common cases
These outcomes follow directly from the rules above and do not depend on the picture.
The photo is already small enough
A 60,000-byte JPEG, Target size 100 KB, 1 KB equals 1,024 bytes
Returned unchanged with the note Already under the target, since 60,000 is below 102,400 bytes
No quality is thrown away on a file that would pass anyway.
A strict checker that counts in thousands
Target size 100 KB, 1 KB equals 1,000 bytes
The limit becomes 100,000 bytes, so the file also passes any check that uses 102,400
Dimensions locked on a small target
A large photo, Target size 20 KB, Keep the original pixel dimensions ticked
If quality 10 is still above 20,480 bytes, a Could not reach 20 KB warning appears with the smallest size achieved
Untick the box and the same photo is scaled down until it fits.
Choosing between 20, 50, 100 and 200 KB
Use the number printed on the form. Application and exam portals, job sites and identity checks state a maximum, and anything at or under it is accepted, so there is nothing to gain from aiming lower than you have to.
Smaller targets cost real detail: first quality goes, then pixel dimensions. A full-resolution phone photo is several megabytes, so expect it to be scaled down for any of these targets. An image already sized for a form, a few hundred pixels across, usually fits by lowering quality alone. A 20 KB limit leaves room for only a small picture, which is why it tends to be set for signatures and thumbnails, where there is little detail to lose.
If a form also gives pixel dimensions, such as a fixed width and height, resize the image to those dimensions first with the Image Resizer, then bring the result here and tick Keep the original pixel dimensions so only quality changes.
How this differs from the Image Compressor
The Image Compressor on this site works the other way round: you pick a quality percentage and the file size is whatever comes out. That suits making a web page lighter, where any reduction helps.
This page starts from the size. You state the limit and the quality and dimensions are worked out for you, which is what you need when a form rejects anything over a fixed number of kilobytes. Use the compressor when you care about how the picture looks, and this tool when you care about what the file weighs.
Limits worth knowing before you rely on it
- One image at a time. There is no batch mode or ZIP download.
- Output is JPEG or WebP only. A PNG source is converted, and in JPEG its transparent areas are filled with white.
- The result is a fresh encode, so EXIF data such as camera model and GPS position is not carried over.
- Browsers ship different encoders, so the same photo and target can give slightly different quality numbers in Chrome, Firefox and Safari. The size limit is honoured in all of them.
- A browser that cannot write WebP reports that and asks you to choose JPEG rather than silently saving another format.
- Scaling stops when the longer side would drop below 16 pixels. Targets too small for a recognisable image are reported as unreachable.
Using Compress Image to KB
- 1
Choose your file under Image (JPG, PNG or WebP). Files up to 30 MB are accepted.
- 2
Enter the limit in Target size (KB): 100 is the default, and 20, 50 and 200 are the other common limits.
- 3
Leave 1 KB equals on 1,024 bytes unless the form you are filling in is known to count 1,000 bytes per KB.
- 4
Pick an Output format: JPEG is accepted everywhere, WebP keeps more detail at the same size.
- 5
Tick Keep the original pixel dimensions only if the width and height must not change.
- 6
Check the Final size and Dimensions in the result, then download the file.