Compress JPG, PNG and WebP images privately
Large images slow down websites, blow past email attachment limits, and fill up storage. This tool reduces image file size while keeping photos looking sharp — useful for web pages, email, CMS uploads with size caps, and freeing up space. It’s for anyone who needs a smaller file without an upload-and-wait round trip.
How it works
The tool loads the browser-image-compression library and runs it in a
background Web Worker, so the page stays responsive. For each file it calls
imageCompression(file, { maxSizeMB, maxWidthOrHeight, useWebWorker: true }).
The library first downscales the image so its longest side fits your pixel cap,
then iteratively re-encodes at decreasing quality until the result is at or below
your target size. The original format is preserved, and each result shows the
before/after size and percentage saved.
Example
A 4.2 MB, 4032×3024 phone photo for a blog post: set Target max size to 1 MB and Max width/height to 1920. The tool downscales to 1920×1440 and re-encodes, producing roughly a 0.8 MB JPG — about a −81% saving — with no visible loss at blog display size.
| Use case | Target size | Max dimension |
|---|---|---|
| Email attachment | 1–2 MB | 2048 px |
| Website hero / blog | 0.2–0.5 MB | 1920 px |
| Thumbnail / avatar | 0.05–0.1 MB | 512 px |
Choosing the right settings
Target max size and Max width/height work together. In most cases, reducing the pixel dimensions is the single biggest saving — a 4,000-pixel wide photo carries roughly four times as many pixels as a 2,000-pixel one, so the file is much larger before any quality encoding even happens. Set both constraints and the tool does whichever reduction is necessary.
Format choice matters more than quality:
- JPG at quality 80 is usually indistinguishable from JPG at quality 95 for photos, but can be 40–50% smaller.
- PNG is lossless, so quality tuning does not apply. A heavily compressed PNG will not look bad — it will just not shrink much if the image has complex content.
- WebP achieves noticeably smaller files than JPG for the same visual quality, but not all email clients and older platforms support it.
When compression reaches its limits
Some images resist aggressive size reduction:
- Already-compressed JPGs re-encode at a quality penalty with little size benefit. If you imported a 200 KB JPG and try to compress it to 50 KB, the results may look noticeably degraded.
- Flat-color PNGs (screenshots, diagrams) compress well with lossless methods but poorly with JPEG encoding. For these, keep the PNG format.
- Very small originals have little room to shrink further, regardless of settings.
If the size saving is unexpectedly small, the most likely cause is that the image was already compressed, or the format is a poor match for the content. Try switching to WebP or reducing the max dimension further.
Compression happens locally in a background Web Worker — your images never leave your device, and the page stays responsive while batches process.