๐Ÿฑ Lunchbox Hands

Image Compressor

Compress images with adjustable quality

Upload an image and adjust the quality slider to compress it. Choose between WebP and JPEG output formats โ€” both support lossy compression for real file size savings. The tool shows original size, compressed size, and percentage savings. Everything runs locally in your browser.

Drop an image here or click to upload

What happens when you click Compress

The tool decodes your image into pixels, draws them onto a canvas at the original width and height, and asks the browser to encode that canvas as WebP or JPEG at the quality you picked (the slider's 1โ€“100% maps to the encoder's 0.01โ€“1.0 quality value). It is a lossy re-encode: the encoder discards fine detail it predicts you will not notice, and the quality number controls how much. Nothing is resized or cropped, so a 4032ร—3024 photo comes out at 4032ร—3024.

HEIC photos from an iPhone are converted first with a WebAssembly decoder, so they work in Chrome, Edge and Firefox as well as Safari. Any other format your browser can display (PNG, JPEG, WebP, GIF, BMP, AVIF in most browsers) can be loaded too. For an animated GIF or WebP, only the first frame is kept.

Reading the result

After compressing, three figures appear. Sizes use 1,024-byte kilobytes, the same convention Windows Explorer uses. Say a 3,482,102-byte JPEG from a phone comes out at 612,455 bytes: the tool shows 3.3 MB original, 598.1 KB compressed and 82% savings, worked out as 1 โˆ’ 612,455 รท 3,482,102, rounded. If the new file is larger, the percentage is negative and shown in red. A 240.0 KB screenshot that grows to 293.9 KB reports โˆ’22%. That is a signal to keep the original or switch approach, not a bug.

WebP or JPEG, and the Safari catch

WebP is selected by default because it generally beats JPEG on size at the same visual quality and supports transparency. JPEG has no alpha channel: transparent areas in a PNG come out black in a JPEG made this way, so pick WebP for logos and cut-outs. Safari's canvas cannot encode WebP. In that case the browser quietly hands back a PNG, and the tool shows a yellow warning and names the download .png rather than mislabelling it. Choose JPEG in Safari, or use Chrome, Edge or Firefox for WebP. For a fuller comparison of the formats, including AVIF, see PNG vs JPG vs WebP vs AVIF.

What it does not do

  • No PNG output and no lossless mode. To shrink a PNG while keeping it a PNG you need palette quantization, which this tool does not do.
  • No AVIF output and no advanced encoder tuning such as MozJPEG. The browser's built-in encoder is used as is, so results vary a little between Chrome, Firefox and Safari.
  • No metadata is kept. EXIF data, including GPS location, is not copied to the output, and embedded colour profiles are not carried over.
  • Changing the slider does not recompress automatically. Click Compress again after each change; switching format clears the previous result.
  • Very large images can exceed a browser's canvas size limit, which is lowest on iPhones and iPads.

For many files at once, the Bulk Image Processor applies one setting to a whole batch and can cap dimensions. If what you need is a smaller file for a web page, resizing first with the Image Resizer usually saves far more than lowering quality, since a 4000-pixel-wide photo shown 800 pixels wide carries 25 times the pixels it needs. If you want AVIF output or per-codec controls on a single image, Google's open-source Squoosh also compresses locally in the browser, using codecs compiled to WebAssembly.

Frequently asked questions

Are my images uploaded anywhere?

No. The image is decoded and re-encoded by your browser's own canvas encoder on your device. Nothing is sent to a server, there is no daily limit, and the file never exists anywhere except your machine and your downloads folder.

What quality setting should I use?

The default of 80% is a good starting point for photos. Between 75 and 85 most people cannot tell the difference at normal viewing size. Check a busy area such as hair, foliage or a sky gradient at 100% zoom, and lower the slider in steps of 5 until you see blocks or banding, then go back one step. At low settings, blocky artifacts become easy to spot on most photos.

Why is my compressed file bigger than the original?

Re-encoding cannot recover detail that a previous compression already threw away, and an image that was already well optimized (or saved at a lower quality than the one you chose) can grow. Screenshots and flat graphics also compress poorly as lossy formats. The Savings figure turns red and shows a negative percentage when that happens, so try a lower quality, the other format, or keep the original.

Should I pick WebP or JPEG?

WebP usually produces a smaller file at a similar visual quality and keeps transparency, and every current browser can display it. Pick JPEG when the image must open in older software, be uploaded to a site that rejects WebP, or when you are using Safari, which cannot encode WebP from a canvas and will save a PNG instead.

Does compressing remove EXIF and location data?

Yes, as a side effect. The output is a freshly encoded image drawn from the pixels, so EXIF metadata such as camera model, timestamps and GPS coordinates is not carried over. If you want to remove metadata without re-encoding and without any quality loss, use the EXIF Remover instead.

Can I compress several images at once or make them smaller in pixels?

Not with this tool. It handles one image at a time and keeps the original width and height. The Bulk Image Processor takes many files at once and can cap the width or height, and the Image Resizer changes dimensions for a single image.

Get weekly dev tools and tips