Compress Image
This page compresses an image with real encoders rather than the browser canvas: MozJPEG for JPG, libwebp for WebP, libavif for AVIF and OxiPNG for PNG, all compiled to WebAssembly and run in a Web Worker. Quality runs from 10 to 100 on the lossy formats, a PNG is optimized losslessly at an effort level from 1 to 6, and an optional resize caps the longest edge at 1920, 1280 or 800 pixels before the encoder starts. When it finishes you see the original size next to the compressed size, the percentage saved, and a slider that compares the two pictures — and the file never left your device.
Add an image
Processing several pictures? Batch Compress Image
Drop an image here
or click to choose · paste with Ctrl+V · JPG, PNG or WebP, up to 20 MB
Press Ctrl+V (⌘ on a Mac) with an image on the clipboard
Preview
Your result shows up here.
Settings
JPEG is encoded with MozJPEG, WebP with libwebp, AVIF with libavif and PNG with OxiPNG — all WebAssembly, all on your own device.
Export
The longest edge of the file you take away. The codec and the quality are in the settings panel, above.
How to compress an image in 3 steps
- 01
Load the picture you want to make smaller
Drop a JPG, PNG or WebP file onto the page, up to 20 MB, choose it from your device, or paste it. The picture is decoded where it already sits and handed to a Web Worker, so the encoder always works from the real file and not from a scaled preview.
- 02
Set the quality, the effort and the size
For JPG, WebP and AVIF, drag the quality slider between 10 and 100; it starts at 75. PNG is lossless, so it gets an effort level from 1 to 6 instead, and a higher level lets OxiPNG search longer for a smaller way to store the same pixels. If the picture is larger than it needs to be, cap the longest edge at 1920, 1280 or 800 pixels — the downscale runs with Lanczos3 before encoding.
- 03
Compare the two files and download
The result panel puts the original size next to the compressed size and reports the percentage saved. Drag the before and after slider to check the detail you gave up at the spot you care about, then press Download and the smaller file is written to your device.
Compression spends detail to save bytes, it does not reframe the picture
Compression keeps the frame and the pixel grid, and pays for the lighter file with detail. The encoders are the real ones: MozJPEG writes the JPG, libwebp the WebP, libavif the AVIF, and OxiPNG rewrites the PNG losslessly, all compiled to WebAssembly and run in a Web Worker. The quality slider from 10 to 100 therefore drives a genuine encoder rather than the browser canvas export, and at 75 a photograph usually reads the same on screen as the source. That separates it from the neighbors. The Crop Image page throws away everything outside your rectangle, which cuts pixels and weight but changes the frame; compression keeps every edge of the frame and only lowers the detail inside it. The Pixelate Image page replaces blocks of the picture with flat color and the mosaic is the point, while a compressed photo stays continuous. The Blur Image page spreads detail over a radius on purpose, because the soft look is what was wanted, not the bytes. Resizing the longest edge is the one lever this page shares with the cropper, and here it is optional and keeps the whole composition. Reach for compression when the file is too heavy to attach, upload or load quickly and the picture itself is already right. This page is the single-picture version: it compresses one picture. When a whole folder has to fit under the same limit, the Batch Compress Image compresses every one of them in turn and hands back a single archive.
Frequently asked questions
Which encoder writes my compressed file?
JPG is written by MozJPEG, WebP by libwebp, AVIF by libavif and PNG by OxiPNG. All four are compiled to WebAssembly and run inside a Web Worker on your device, so the output comes from the same class of encoder desktop tools use, not from the browser canvas. Choose the format in the settings panel and the matching codec handles that job.
Why does a PNG use an effort level instead of a quality slider?
PNG is lossless, so every pixel comes out exactly as it went in and there is no quality to trade away. OxiPNG instead spends more time looking for a smaller way to store those same pixels. Effort 1 finishes fastest, effort 6 tries hardest and is slowest, and the extra savings get smaller as the level rises. A middle level is a reasonable default unless one file really has to be as light as possible.
What does the before and after slider show me?
It places the original and the compressed result in the same frame so you can drag across and compare the same spot in both. Below it, the panel reports the original size, the compressed size and the percentage saved, read from the files the encoder actually produced rather than estimated from the settings you chose.
How much smaller will my file get?
There is no fixed ratio: it depends on the picture, the format, the quality and whether you resize. A busy photograph at quality 75 usually sheds far more than a flat graphic at the same setting, and capping the longest edge at 800 pixels cuts the pixel count on its own. The panel measures the real bytes after encoding, so the number shown is the number you download.
Can I resize as part of compressing?
Yes. The longest edge can stay Original or be capped at 1920, 1280 or 800 pixels, and the downscale runs with Lanczos3 before the encoder starts. Capping the edge lowers the pixel count, which often saves more than the quality slider alone. Keep Original when the picture has to stay at full size, for instance when it is going to print.
Compression happens on your computer
Compression runs on your own computer. The file is decoded in the browser, encoded by the WebAssembly codec in a Web Worker, and measured there; nothing is uploaded to a server and no copy is kept anywhere else. JPG, PNG and WebP images of up to 20 MB each are accepted, so a heavy camera frame or a screenshot both fit. The download is produced on this page from the bytes the encoder returned, with no server round trip in the middle of it.