Image Compressor (Compress to Target Size KB/MB)
Compress JPG, WebP, and PNG images to an exact target file size or quality percentage in your browser.
How to use
- Drop or select one or more JPG, WebP, or PNG images from your device.
- Pick Target size (such as 100 KB or 200 KB) or switch to Quality % mode, and choose WebP or JPEG for PNG inputs.
- Click Compress images, review the final size, quality, and dimensions per file, then download individually or as a ZIP.
Key capabilities
- Binary search finds the highest encoder quality (10% to 100%) that fits under your KB or MB target
- Automatic stepwise dimension downscaling (down to 10% scale) when minimum quality alone cannot reach the target
- 100% browser-only Canvas compression with honest EXIF stripping notice and batch ZIP download
Why compress images to a target file size
Web forms, government portals, job applications, and CMS uploaders often enforce strict file size caps such as 100 KB, 200 KB, or 1 MB. Guessing a quality percentage by trial and error wastes time, especially when you have several photos or screenshots to upload.
In Target size mode, this tool runs a fast binary search across Canvas encoder quality levels between 10% and 100%. It finds the highest visual quality whose output stays at or below your chosen byte limit, so you do not sacrifice sharpness unnecessarily.
What happens when minimum quality is still too large
A high-resolution photo from a phone or camera can still exceed 100 KB even at 10% JPEG or WebP quality. When that happens, the compressor steps down the image dimensions proportionally (85%, 70%, 55%, and lower, stopping at a 10% scale floor) and searches quality again at the smaller resolution.
Each file row reports the exact final dimensions, encoder quality, savings percentage, and whether the target size was reached. If a tiny target like 5 KB cannot be met even at 10% scale and 10% quality, the tool outputs the smallest result it achieved and marks the row honestly instead of failing silently.
Format handling for JPEG, WebP, and PNG
JPEG and WebP inputs keep their original format during compression. PNG uses lossless compression, so browsers ignore the quality parameter when encoding PNG and cannot shrink a PNG to an arbitrary KB target by quality alone. For PNG inputs, the tool converts to WebP or JPEG based on your selection.
If your output format is JPEG, transparent pixels from a PNG are filled with solid white (#ffffff) before encoding because JPEG has no alpha channel. You can also switch to the Quality % tab whenever you want a fixed quality level across a batch without a byte cap.
Privacy, EXIF metadata, and batch limits
Every image is decoded, resized, and re-encoded locally in your browser using the HTML5 Canvas API, with zero network uploads. As a side effect of Canvas re-encoding, embedded EXIF metadata such as camera model, orientation tags, and GPS coordinates is stripped from the compressed output.
Files can be up to 50 MB each, with a 150 MB total batch cap and a 40-megapixel per-image decoding limit. Compressed files get a -compressed suffix and can be downloaded one by one or packaged into a single ZIP archive.
Frequently asked questions
- How does Target size mode hit 100 KB or 200 KB automatically?
- The compressor runs a binary search over Canvas quality values from 10% to 100% and checks the resulting Blob size at each step. It picks the highest quality that stays at or below your target size in at most 8 attempts.
- Why are my PNG files converted to WebP or JPEG?
- PNG is a lossless format, so browsers ignore the quality setting when saving PNGs and cannot reach a specific KB limit by quality alone. Converting PNG inputs to WebP or JPEG lets the encoder trade imperceptible detail for much smaller file sizes.
- What if my image is still larger than the target at 10% quality?
- The tool automatically scales down the image dimensions in steps (down to a minimum of 10% of the original width and height) until the file fits. If even 10% scale at 10% quality exceeds the target, it keeps that smallest result and tells you the target was not reached.
- Does compressing an image remove EXIF metadata and GPS data?
- Yes, drawing an image onto an HTML5 Canvas and exporting a new JPEG or WebP drops all embedded EXIF, IPTC, and XMP metadata. No files are ever sent to a server because all compression runs locally in your browser.
Related tools
- ImageOpen tool
EXIF & GPS Metadata Remover
Inspect and strip camera model, timestamp, and GPS location metadata from photos locally in your browser.
- ImageOpen tool
Batch Image Format Converter (PNG, JPG, WebP)
Convert and resize multiple PNG, JPG, and WebP images locally in your browser.
- ImageOpen tool
Batch Image Resizer (PNG, JPG, WebP)
Resize PNG, JPG, and WebP images by pixels or percentage locally in your browser.