Compress Image to a Target File Size
Enter the file size you need (for example 200KB) and this tool searches for the highest quality that still fits, right in your browser. It is handy for upload forms with a size limit. If you would rather set quality or dimensions yourself, use the Image Resizer & Compressor.
🔒 Runs in your browser · Your data is never sent to a server
You can also drag and drop image files here (multiple allowed)
Compressed files
How to use
- Choose your image files (multiple files and drag & drop are supported).
- Enter the "Target file size" and its unit (KB or MB).
- Pick the "Output format" (JPEG or WebP) and, if needed, allow shrinking the image.
- Check the compressed size in the results list, then download the files.
Notes
- The target is calculated with 1KB = 1024 bytes. If the site you upload to counts 1KB as 1000 bytes, enter a slightly smaller value.
- Compression is lossy (JPEG or WebP). Transparent areas become white in JPEG; choose WebP if you need to keep transparency.
- Only when even the lowest quality is too big and "Also shrink the image if lowest quality is not enough" is on, the image is scaled down step by step with its aspect ratio kept. If it is off, the tool reports that the target was not reached.
- If the original is already smaller than the target, re-encoding can still make it larger. In that case, keep using the original.
- Animated GIFs output only their first frame.
- All processing happens in your browser — the images you select are never sent to a server.
Glossary
Binary search
A search that tries the middle of a range and halves the range depending on whether the result fits. Here it finds the highest quality (1-100) under your size limit in about ten encodes or fewer.
Lossy compression
A method that shrinks files by discarding some data. JPEG and WebP are lossy: lower quality means a smaller file, but the original quality cannot be restored.
FAQ
Why is the result not exactly my target size?
The tool looks for the highest whole-number quality (1-100) that stays under the target, so the result is usually a little smaller. If the next quality step would go over the limit, the one below it is used.
What if lowering the quality is not enough?
If "Also shrink the image if lowest quality is not enough" is on, the image is scaled down step by step (90%, 80%, ...) with its aspect ratio kept and searched again. If it is off, the tool tells you the target was not reached and shows the smallest size it got.
How many bytes is 1KB here?
The tool uses 1KB = 1024 bytes and 1MB = 1024KB. If the site you upload to counts 1KB as 1000 bytes, leave some margin, for example aim for about 190KB for a 200KB limit.
Can I compress PNG or GIF files to a target size?
You can load them, but the output is JPEG or WebP, because PNG is lossless and its size cannot be tuned with a quality setting. Choose WebP to keep transparency.
Share this page
