MozJPEG
Mozilla's improved JPEG encoder — same JPEG format, about 5% smaller files on average at equal quality, by Mozilla’s own measurement.
On this page
Definition
MozJPEG is a JPEG encoder maintained by Mozilla. It improves on the standard libjpeg encoder with trellis quantization (choosing coefficients that compress better at equal visual quality) and progressive encoding, producing JPEGs that Mozilla measured at about 5% smaller on average than libjpeg-turbo at the same visual quality (some images shrink more) while remaining 100% standard JPEG files.
In practice
Because MozJPEG output is a standard JPEG, it works everywhere JPEG works — no browser or tool changes needed. ImageAlchemy uses MozJPEG for its JPEG output path.
Source for the size figure: Mozilla’s MozJPEG 2.0 announcement (July 2014), which reports that MozJPEG 2.0 “can reduce file sizes … by 5% on average” compared with libjpeg-turbo.
Why the encoder matters more than the format
People discuss image formats as though the format decides the file size. It does not. The encoder decides, and JPEG is the clearest example.
JPEG has been a fixed standard since 1992. Any compliant encoder produces files that every decoder reads. What the standard does not dictate is how hard the encoder works to choose good coefficients — and that is where MozJPEG’s saving comes from. Two encoders can produce mathematically valid JPEGs from the same source, at the same quality setting, with visibly different file sizes.
MozJPEG is essentially libjpeg with a great deal more effort spent on those choices. To you this is pure gain: smaller files, identical compatibility, no quality trade-off. There is no downside beyond slightly slower encoding.
Progressive and baseline JPEG
The other MozJPEG improvement is less obvious but affects perceived speed.
Baseline JPEG stores the image top to bottom. A slow connection shows it filling in from the top, like a curtain being drawn down.
Progressive JPEG stores several passes at increasing detail, so the whole image appears blurry almost immediately and then sharpens. Same final quality, same file size class, but the page feels faster because the visitor sees something meaningful sooner.
Progressive is the better default for web use, and MozJPEG enables it. Note that progressive JPEGs are slightly more expensive to decode, which matters only on very constrained devices and rarely outweighs the perceptual benefit.
Related guides
Compress your images now — free and private
Process up to 200 images locally. Choose a format, compare the results and download a ZIP.