Image Compressor

Compress PNG, JPEG and WebP images in your browser with MozJPEG, WebP and OxiPNG, keeping the smallest result. Files never leave your device.

Back to tools

Drop PNG, JPEG, or WebP images here or click to browse

Smart compression · up to 20 files · 20MB each · stays in your browser

How to compress images

This tool makes photos, screenshots and graphics smaller so pages load faster, emails stay under attachment limits and upload forms stop rejecting your files. Drop in up to 20 JPEG, PNG or WebP images and each one is compressed automatically. There are no sliders to tune: the tool tries several encoders on every image and keeps whichever result is smallest without visible damage.

The encoders are the same ones used by Google's Squoosh app, compiled to WebAssembly through the @jsquash packages: MozJPEG for JPEG, libwebp for WebP and OxiPNG for lossless PNG optimization. Everything runs on your device, so product shots under embargo, client photos and screenshots of internal dashboards are never uploaded anywhere.

How to use it

  1. Drag images onto the box that says Drop PNG, JPEG, or WebP images here or click to browse, or click it to pick files. Up to 20 files of 20MB each are accepted per batch.
  2. Wait while each row shows Compressing…. Images are processed one after another, and each row then shows the original and new size with a label such as 62% smaller.
  3. If the format changed to save space, the new file name appears next to the result, for example banner.webp.
  4. Click Download on a row to save one image, or Download All as ZIP to get every result in compressed-images.zip.
  5. Click Clear before starting a new batch. Adding new files also replaces the current list.

Example

How the output format is chosen

These rows use example sizes to show the selection rule in the code. A result in the original format wins if it is no more than 8% larger than the smallest candidate; otherwise the smallest file wins, even in a different format. If nothing is smaller than the original, the original is kept.

Original and candidate sizes
photo.jpg 2.4 MB: MozJPEG 640 KB, WebP 600 KB
photo.jpg 2.4 MB: MozJPEG 640 KB, WebP 540 KB
screenshot.png 1.8 MB: OxiPNG 1.35 MB, WebP 210 KB
icon.png 90 KB: WebP 95 KB, nothing smaller
Result
photo.jpg (JPEG kept, 73% smaller)
photo.webp (WebP chosen, 78% smaller)
screenshot.webp (WebP chosen, 88% smaller)
icon.png (Already optimal)

What happens to each image

Each file is decoded to raw pixels and then re-encoded in up to three ways. A lossy WebP at quality 80 is always tried. A MozJPEG at quality 80 is tried when the original is a JPEG or when the image has no transparent pixels. A lossless OxiPNG pass at optimization level 3 is tried when the current file is a PNG. Candidates that are not smaller than the input are thrown away, and the best of the rest is picked using the 8% rule shown in the example, so you keep your original format whenever the saving from switching is small.

If the first pass helps, the tool repeats the process on its own output, up to five passes in total, but only while each extra pass saves at least 5%. In practice most images settle after one or two passes. When no candidate beats the original, the row says Already optimal and the download is your untouched file.

Lossy or lossless, and which format to keep

Lossless compression, like OxiPNG, rewrites a PNG more efficiently without changing a single pixel. Savings are modest, often 5% to 30%, but the image is identical. Lossy compression, like MozJPEG and lossy WebP, throws away fine detail the eye is unlikely to notice. Savings are much larger, often more than half, but the pixels are not exactly the same as before.

Because the tool picks the smallest result, an opaque PNG screenshot may come back as a WebP or JPG, and a transparent PNG may come back as a WebP with its transparency intact. Transparent images are never turned into JPG, since JPG cannot store transparency. That is the right trade for websites, where every modern browser shows WebP. It is not always right for other uses:

  • Keep PNG for logos, icons, pixel art, diagrams with thin lines and anything you will edit again. If the result switched format and you need PNG, use the original or a dedicated PNG tool.
  • Keep JPEG for photos going to print shops, older content management systems or email clients that may not display WebP.
  • Use WebP for web pages, blogs and online stores, where it usually gives the smallest file at the same visual quality.

Things to know before you compress

Compression starts from the pixels, so metadata such as camera EXIF data, GPS location and embedded comments is not carried into the new file. That is useful for privacy when sharing photos online, but if you rely on that metadata, keep the originals. The image dimensions never change: a 4000 by 3000 photo stays 4000 by 3000. For the biggest savings on very large photos, resize them to the size they will actually be shown at before compressing.

Avoid compressing the same lossy file over and over in separate sessions, since each round of lossy encoding loses a little more detail. Run compression once on your best original instead. Animated images are decoded as a single frame, so do not use this tool on animated WebP files. Files over 20MB, other formats such as GIF, HEIC or AVIF, and anything beyond the first 20 files are listed in an error message rather than processed. To bundle the results with other documents, the Zip & Unzip Files tool can package them, and the PDF to Image Converter can feed it page images to shrink.

Related tools

More utilities that pair well with this one.

Frequently asked questions

Common questions about this tool.