VeryEasyTools

Tests

Is MozJPEG Really Smaller? A Same-Quality Comparison With the Browser’s Own Encoder

VeryEasyTools · 4 min read

20–30% → 1–7%MozJPEG savings at matched quality

How this was measured

Photos
4 public photos (Lorem Picsum, Unsplash License) resized to 3024 and 2048 px wide, 8 images in all
Compared
Chrome canvas.toBlob (JPEG) vs. MozJPEG (@jsquash/jpeg, with the settings this site uses). Both with 4:2:0 color
Quality
Compared with the original using SSIM (luma). MozJPEG sizes at equal SSIM were interpolated from nearby quality settings
Measured
November 11, 2026; iPhone records from November 4, 2026

Photo compressors often advertise “smaller files at the same quality with MozJPEG”, and Compress Image on this site uses MozJPEG too. So how much smaller is it, compared with the JPG a browser saves by default? The answer turned out to be more modest than I expected, and the numbers changed a lot depending on how the comparison was done.

Two ways to make a JPG

The easiest way for a web page to save a photo as JPG is to leave it to the browser: draw the image on a canvas, call canvas.toBlob('image/jpeg', quality), and the browser produces the JPG. Chrome uses a JPEG library called libjpeg-turbo for this. Saving the same photo with Chrome and running libjpeg-turbo directly (with optimized Huffman tables) gave nearly identical sizes and quality, down to the byte.

MozJPEG is a JPEG encoder Mozilla built on libjpeg-turbo to pack the same quality into fewer bytes. It uses quantization tables tuned to human vision, trellis quantization, progressive encoding and so on. Browsers don’t include it, so a page has to download it separately as WebAssembly.

Making the comparison fair

In an encoder comparison, one mismatched setting can change the result a lot. I evened out three things.

  • Color subsampling (4:2:0): because the eye is less sensitive to color than to brightness, JPG can store color at half the width and height. The MozJPEG package this site uses (@jsquash/jpeg) by default subsamples color less at quality 80 and above (4:2:2 or 4:4:4), so left alone it would store more color than Chrome and be at a disadvantage. Both were set to 4:2:0.
  • Source images that aren’t already JPG: if a test photo is already a JPG, re-saving it with the same library at the same quality reproduces it with almost no loss, which favors one side. This actually happened in my first measurement, so I resized the photos to shift the 8 × 8 block grid before measuring again.
  • Quality score: SSIM, which tracks human perception reasonably well, was measured on brightness, since color had already been reduced equally with 4:2:0.

At “quality 75” it looks 20–30% smaller

First, the usual approach: give both encoders the same quality number, 75, and compare sizes.

Photo (3024 px wide) Chrome, quality 75 MozJPEG, quality 75 Difference
Fjord 1,133 KB 885 KB −22%
Latte 404 KB 282 KB −30%
Puppy 1,093 KB 753 KB −31%
Waterfall forest 1,316 KB 1,068 KB −19%

Going by this, MozJPEG is 20–30% smaller. But the quality scores show that MozJPEG came out slightly lower on all four (for example, fjord 0.975 → 0.966). A quality number means something different to each encoder. At the same 75, MozJPEG discards more, and that is why it was smaller.

At matched quality: 1–7%

A fair comparison has to match quality first and then look at size. I saved each photo with MozJPEG at many settings from quality 50 to 95 to find the size at which its SSIM equals Chrome’s.

MozJPEG size at the same quality (SSIM) as Chrome (Chrome = 100)

3024 px wide, matched to Chrome quality 85

Fjord96.8
Latte98.1
Puppy92.9
Waterfall forest96.2

Resized to 2048 px wide, matched to Chrome quality 85

Fjord99.0
Latte97.7
Puppy95.5
Waterfall forest97.3

At the same quality, MozJPEG was 1–7% smaller. Matching against quality 75 instead gave similar results, 1.4–6.7%. The gap was largest for the puppy, full of fine fur, and the smoother the photo, the smaller it got. That is a long way from the 20–30% of the “same quality number” comparison.

The gap was larger on iPhone photos

While building the photo tool, I also measured four real iPhone photos at their original resolution. There, MozJPEG was usually 7–20% smaller at matched quality, around 10% on average. Phone photos have more noise and fine texture than the public photos, which MozJPEG seems to handle better. On the other hand, when landscape photos were reduced to 2048 px on the long side, MozJPEG was 6–9% bigger. The honest conclusion is that it wins on some photos and loses on others.

Why use MozJPEG anyway

The size gain is modest, yet Compress Image uses MozJPEG for other reasons.

  • iPhone Safari’s built-in save barely compresses. With canvas.toBlob in iPhone Safari, even quality 60 left a quality score above 0.99, hardly compressing at all, and a 24 MP photo would not go below 1 MB. The same photo saved with MozJPEG at quality 60 was 396 KB. To hit a target such as “under 300 KB”, I couldn’t rely on a built-in save that behaves differently in each browser.
  • Same result on every device. Because MozJPEG runs as WebAssembly, the same quality number produces the same result in Chrome, Safari and on Android, so the search for a target size doesn’t wobble from device to device.
  • It’s fast enough. On iPhone, saving one 24 MP photo with MozJPEG took 1.1–1.4 seconds, and a photo reduced to 2048 px on the long side took 0.25–0.3 seconds.

Big savings come from resolution

Changing encoders buys you 10–20% at most. What really shrinks a photo is resolution. In this test, reducing the same photo from 3024 to 2048 px wide cut it to about half at the same quality 85 (fjord 1,519 KB → 767 KB). For photos headed to a blog or a chat, deciding the resolution first matters more than the encoder.

One more thing: when you see a claim of “tens of percent smaller at the same quality number”, check whether the quality was the same too. Often only the number matches.

Try it yourself

Compress many photos at once to the size you need. Keeps the HDR brightness and date taken of iPhone photos (HEIC).

Open Compress Image →
All blog posts →