Tools / Image / Image Compressor
Client-side

Image Compressor

Shrink JPG, PNG, WebP, BMP, TIFF and AVIF files locally: compare MozJPEG, WebP, AVIF and PNG output sizes for your own image, check the result in a before-and-after split view, then download one file or a ZIP.

What it does

  • MozJPEG, WebP, AVIF and lossless PNG codecs
  • Size table compares all four codecs on your image
  • Draggable before-and-after split preview
  • Quality slider from 1 to 100 for lossy codecs
  • Batch compression with a single ZIP download
  • Runs locally in Rust and WebAssembly, no upload

Drop files here or click to browse

PNG, JPG, WebP, BMP, TIFF, or AVIF

This image compressor reduces the file size of JPG, PNG, WebP, BMP, TIFF and AVIF images by re-encoding them with one of four codecs: MozJPEG, WebP, AVIF or PNG. It encodes your image with every codec at the current quality and shows the resulting sizes in a table, so you see which format wins for this particular picture before downloading. Everything runs in your browser tab, through Rust compiled to WebAssembly.

How to compress an image

  1. Drop one or more images on the drop zone, or click to pick them. Accepted inputs are PNG, JPG, WebP, BMP, TIFF and AVIF.
  2. Choose a codec: MozJPEG (selected by default), WebP, AVIF or PNG.
  3. Move the quality slider (default 75). The codec table and the preview refresh automatically after a short pause.
  4. Drag the divider on the preview to compare the original (left) with the compressed version (right) on the same area, and read the output size and reduction figures above it.
  5. Click Compress, then Download. A single file is saved as name-compressed.jpg (or .webp, .avif, .png). Several files arrive as one compressed-images.zip.

Which codec to choose

The codec decides the output format too: choosing WebP for a JPG source produces a .webp file, so compression and conversion happen in one step.

  • MozJPEG: a JPEG encoder designed to produce smaller files than a standard JPEG encoder at similar visual quality. The output is an ordinary .jpg that opens everywhere, the safe choice for email, forms and CMS uploads. JPEG has no transparency, so transparent areas are filled with white.
  • WebP: supported by all current major browsers and usually smaller than JPEG for photos. The tool uses your browser's built-in lossy WebP encoder so the quality slider applies. If the browser cannot produce lossy WebP, a note appears and the tool falls back to lossless WebP, which can be much larger.
  • AVIF: often the smallest output for photos at a given quality, at the cost of slower encoding. Large images can take a few seconds. Best for websites, less so for files opened in older desktop software.
  • PNG: lossless. The quality slider is hidden because no detail is discarded. PNG suits screenshots, diagrams and graphics with flat colors or transparency, but re-encoding a photo as PNG usually makes it bigger.

Reading the codec comparison table

For each codec, the table shows the output size at the current quality and the change against your original. A minus sign means a smaller file; a plus sign means that codec made it larger, as happens when an optimized JPEG is re-encoded as PNG. With several files selected, the preview and table use the first file, and the chosen codec and quality then apply to the whole batch.

What quality setting to use

The slider runs from 1 to 100 and only affects MozJPEG, WebP and AVIF. There is no universal right value, which is why the split preview exists: lower the quality until artifacts appear where it matters (faces, small text, skies), then go back up a few steps. The default of 75 suits most web photos. Screenshots with small text show artifacts sooner, so choose PNG or a high quality for those.

Compressing versus resizing

Compression keeps the pixel dimensions and reduces how many bytes each pixel costs. If your photo is 6000 pixels wide and will be displayed at 1200, the biggest saving comes from reducing the dimensions first: use the image resizer to set exact pixel sizes, then compress the result here. To change format without comparing codecs, the image converter or a direct page such as PNG to WebP is quicker. For documents rather than pictures, use Compress PDF.

Limits and edge cases

  • Photos with an EXIF orientation flag are turned upright before encoding, so they do not come out sideways.
  • Re-encoding a file that is already heavily compressed rarely saves much and can add artifacts. The reduction column shows this immediately.
  • Files are processed in memory, so the practical size limit is your device's RAM.
  • AVIF sources are decoded by your browser, so they need a browser that can display AVIF.

Compared with desktop and command-line tools

Photo editors offer these codecs in their export dialogs, and on the command line encoders such as cjpeg from MozJPEG, cwebp or avifenc handle one format each. They remain the right choice for scripted pipelines over thousands of files. This page covers a handful of images, when you want to know which format gives the smallest acceptable file without installing anything.

Your images stay on your device

Decoding and encoding run inside the browser tab: MozJPEG, AVIF and PNG through Rust compiled to WebAssembly, lossy WebP through the browser's own encoder. No image is sent to a server, so there is nothing to delete afterwards. That matters for the files people compress before sending: ID scans for an online application, screenshots of internal dashboards, unreleased product shots. You can check it in the Network tab of your browser's developer tools, or disconnect from the internet once the page has loaded and keep compressing.

Frequently asked questions

How do I reduce the size of a JPG without visible quality loss?
Keep MozJPEG selected, lower the quality step by step and watch the split preview on the parts of the image that matter. Stop when you see blocking or blur, then raise the quality slightly. The output size updates as you go.
Why is my PNG bigger after compression?
PNG output is lossless and the tool does not reduce the number of colors, so a photo saved as PNG keeps every pixel exactly and is often larger than the source. For smaller files choose WebP or AVIF, which keep transparency, or MozJPEG if the image has no transparent areas.
Can I compress several images at once?
Yes. Select or drop multiple files. The codec and quality you set on the first image are applied to all of them, and the results download together as compressed-images.zip. If one file fails, the others are still processed and the failure is listed.
What happens to transparency?
WebP, AVIF and PNG keep the alpha channel. MozJPEG produces a JPEG, which cannot store transparency, so transparent pixels are composited onto a white background.
Does compression change the image dimensions?
No. Width and height stay the same. To make the image smaller in pixels, use the image resizer first.
Are my images uploaded anywhere?
No. The images are read into memory, encoded locally and offered as a download from the same tab. No network request carries your files.