How to compress an image to a specific size in kB
- Click Select image and choose a PNG, JPEG or WebP file. The tool compresses it right away with the default settings, which are JPEG at 80% quality.
- Under Compression goal, choose Target size if a form or CMS limits the file size. Otherwise keep Target quality and use the Quality slider, which goes from 5% to 100%.
- Type your limit in the Target size (kB) field. Then press Enter, click outside the field or click Compress image. The tool tries several quality levels and keeps the highest one it found that fits. If even 5% is too big, you still get the 5% file, and it is over your limit.
- Pick a format in Output format. JPEG, WebP and PNG are listed, and AVIF appears only if your browser can create AVIF files.
- Check the numbers in the result panel and click Download. The file is saved as
compressed-image.jpg,.webp,.pngor.avif.
The tool counts 1 kB as 1,024 bytes, so a target of 100 means at most 102,400 bytes. Some upload forms count 1 KB as 1,000 bytes. For those forms, enter a slightly lower target, for example 97 for a "max 100 KB" field (97 × 1,024 = 99,328 bytes).
Reading the result numbers
Saving is the original size minus the compressed size, shown as a percentage of the original:
| Original (bytes) | Compressed (bytes) | Original shown | Compressed shown | Saving |
|---|---|---|---|---|
| 3,145,728 | 1,153,434 | 3.0 MB | 1.1 MB | 63.3% |
| 1,048,576 | 99,328 | 1.0 MB | 97.0 kB | 90.5% |
| 512,000 | 194,560 | 500.0 kB | 190.0 kB | 62% |
| 204,800 | 245,760 | 200.0 kB | 240.0 kB | -20% |
If Saving is negative, the compressed file is larger than the original.
In Target size mode, Used quality shows the quality level the tool picked to meet your limit. If it shows 5%, the tool reached the lowest level. Compare the Compressed size with your limit in that case, because the file may still be too large.
To check for compression damage, set Artifact zoom to 2× or 4×. Then move the Before / after split slider so the divider passes over text edges, skies and fine textures such as hair. If you can see blocks or halos at 1×, raise the quality a few points.
Which format and setting to use
- Upload forms with a size cap, such as job portals, ID photos or CMS fields that reject files over 200 kB: use Target size with JPEG and enter the limit. Enter a slightly lower number if the form counts 1 KB as 1,000 bytes.
- Photos for a website: WebP and JPEG both appear in Output format. Compress the photo in both at the same quality and keep whichever file is smaller.
- Screenshots and diagrams with large flat areas of colour: PNG keeps edges and text sharp. Compare the result with the original, because re-saving a PNG does not always make it smaller.
- Email attachments: 70–80% JPEG quality usually makes a phone photo noticeably smaller, but at full resolution it often stays above 1 MB. To get down to a few hundred kB, first reduce the dimensions with the Image Resizer, then compress the result here.
Limits and when to use a different tool
- Only PNG, JPEG and WebP files are accepted, up to 20 MB and 40 megapixels. GIF, SVG, HEIC and other formats are not accepted. If one gets through the file picker, the tool shows "Choose a valid image file."
- The tool works on one image at a time.
- The image dimensions stay the same, so a 6000 × 4000 photo is still 6000 × 4000. For very small targets, such as an avatar under 20 kB, resize the image first.
- PNG is lossless. The quality value has no effect on PNG output, and Target size works only with JPEG, WebP or AVIF.
- Transparency is lost in every output format: transparent areas become white.
- If you only need a different file type, for example WebP to JPEG for an older app, the Image Format Converter is the simpler choice.