How to use
- Drop one or more images onto the workspace (they stay on your device).
- Pick an output format. WebP is the best default; AVIF appears only if your browser can encode it.
- Choose Target size and type a limit such as 200 KB, or switch to Fixed quality.
- Optionally set a max width — shrinking pixel dimensions saves far more bytes than lowering quality.
- Press Compress, drag the slider to compare, then save each file or download them all as a ZIP.
How it works
The image is drawn onto an HTML canvas and re-encoded with the browser's own encoder via canvas.toBlob(type, quality). File size grows with the quality setting, so the tool runs a binary search on quality:
- Encode at quality 0.95. If that already fits, stop — there is no reason to degrade the image.
- Encode at 0.05. If even that is too big, report it and suggest reducing dimensions.
- Otherwise bisect the range up to seven times, keeping the best encode that fits. Each step halves the uncertainty, so seven steps narrow 0.9 of range to about 0.007.
Target sizes use SI units, where 1 KB = 1000 bytes, because that is how most upload limits are stated. Type KiB if you need 1024-byte units.
Worked example
Suppose a 4032 × 3024 phone photo is 3.1 MB as a JPEG, and you ask for WebP, a max width of 1600 px and a 200 KB target. Illustratively, the first probe at quality 0.95 might come out near 520 KB (too big) and the floor at 0.05 near 40 KB (fits). The search then tries 0.5, 0.725, 0.6125 and so on, moving up whenever a result fits and down whenever it does not, and returns the best fitting encode — here roughly a 94% saving. Real numbers depend on the image and the browser: a noisy, detailed photo needs more bytes than a clean studio shot.
Limitations
- Quality is searched, not perceptually measured: two images at the same size can look different. Always check with the slider.
- Browser encoders differ. Chrome, Firefox and Safari produce slightly different sizes for the same setting.
- Animated GIF or WebP input becomes a single still frame.
- Very large images (above roughly 16,000 px on a side, or 250 megapixels) may exceed the browser's canvas limits.
- Colour profiles other than sRGB may be converted to sRGB when re-encoded.
FAQ
Why did my file get bigger?
If the original was already heavily compressed, re-encoding at high quality can produce a larger file. The tool flags this; keep the original in that case, or lower the target.
Is AVIF better than WebP?
AVIF usually makes smaller files at the same visual quality, but it encodes slowly and only some browsers can create it from a canvas. When your browser cannot, the AVIF option is disabled rather than silently falling back.
Does compression remove EXIF and GPS data?
Yes. The canvas only holds pixels, so the exported file carries no EXIF block: camera model, timestamps and GPS coordinates are not copied. Orientation is applied to the pixels before export, so photos stay the right way up.
Why can't it reach my target?
At the lowest quality the image still has too many pixels. Set a max width (for example 1200 px) and run it again; halving the width cuts the pixel count by four.
Are my images uploaded?
No. Encoding happens inside this browser tab. You can load the page, go offline, and the compressor still works.