Skip to content

Image Compressor

Make photos and screenshots smaller for email, forms and websites. Choose a quality or a size to fit under, compare before and after, and keep every file on your device.

Key facts

  • Compresses JPG, PNG and WebP in your browser with MozJPEG, OxiPNG and the browser’s WebP encoder; nothing is uploaded.
Save as

Drop images here

JPG, PNG or WebP keep their format; HEIC and AVIF become JPG. As many as you like.

Your images are compressed on this device and never uploaded. Metadata (EXIF, GPS) is removed.

How this works: Method, 7 sources, Checked against 7 worked examples,

How this works

Method

Each image is decoded by the browser, turned upright, resized if asked and drawn on a canvas in a background worker. JPEGs are encoded with MozJPEG at your quality; PNGs are cut to the colours you choose by median cut with softened Floyd–Steinberg dithering, then packed by OxiPNG; WebPs use the browser’s encoder. For a target size, real encodings are bisected for the best setting that fits, shrinking the picture if even the lowest is too big. Files are rebuilt from pixels, so no EXIF is kept.

How it’s tested

7 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • First version: JPG, PNG and WebP compression by quality or target size, a before and after view, resize, ZIP download, and Compress JPEG and Compress PNG pages.

How we make toolsReport a mistake

How the compressor makes files smaller

JPEGs are re-encoded with MozJPEG, Mozilla’s JPEG encoder, which squeezes more out of the standard format than a browser’s built-in encoder does: progressive encoding, optimised coding tables and trellis quantisation. Any program that opens a JPEG opens these.

PNGs are made smaller by reducing them to at most 256 colours, with gentle dithering so gradients don’t band, and storing them as an indexed PNG, packed by OxiPNG. Screenshots, logos and illustrations often look identical; detailed photos are better as JPEG.

WebPs are re-encoded with the browser’s WebP encoder. Resizing often saves more than any setting: a photo shown 1,200 pixels wide doesn’t need 4,000.

Every file is rebuilt from its pixels, so camera details and GPS location are not carried over. If a WebAssembly encoder can’t load, the browser’s own encoder is used instead and the list says so; the sizes shown are always those of the real files you download.

Good to know

Open-source code inside, loaded only when needed: JPEGs are encoded with MozJPEG, PNGs packed with OxiPNG and WebP written with libwebp where the browser can’t. Pictures, HEIC included, are decoded by the browser itself. Licences and source

How to compress images3 steps, all on your device
  1. Drop your images. Add JPGs, PNGs or WebPs, one or many. Each keeps its format; HEIC and AVIF photos become JPGs.
  2. Choose quality or a target size. Drag the quality slider and watch the size, or switch to Target size and enter the limit, such as 100 KB; the compressor finds the best quality that fits.
  3. Compare and download. Drag the divider over the picture to compare before and after, then save each file or all of them as a ZIP.

Frequently Asked Questions

Are my images uploaded to a server?

No. Compression happens in this browser tab, in a background worker. The footer’s “On this device” counter shows what the page has sent, and compressing adds nothing. Close the tab and the files are gone from memory.

How do I compress an image to 100 KB (or 50 KB)?

Choose Target size and pick 100 KB (or type any size). The compressor tries qualities until it finds the best one that fits. If even the lowest quality is too big, it makes the picture smaller step by step until it fits, and the list says so.

Will compressing reduce the quality?

JPEG and WebP compression are lossy: lower quality means a smaller file and less fine detail. Most photos still look right at the default of 75; use the before and after view to check, and raise the quality if you see blockiness or smudged edges.

Why is my file bigger after compressing?

An image that was already compressed hard can come out larger at a high quality setting. Lower the quality, switch to Target size, or resize it. The list always shows the real before and after sizes.