What JPEG quality should you use?

ReferenceWhat quality 60, 75 or 95 actually does to a JPEG's size and quality: measured curves from the exact encoder this site runs in your browser, free to download.

The short answer

For photographs, quality 75 to 85. On our corpus, quality 75 produces files around 1.1 bits per pixel; quality 95 produces 3.3 times as much file for a quality improvement you need a measuring instrument to state. Below about 60 the trade reverses: the file barely shrinks while the damage becomes visible. For screenshots, diagrams and anything with hard edges and text, the honest answer is a different format, and the numbers below show why.

Every figure on this page was measured, not quoted: the same encoder builds this site’s image compressor runs in your browser, over a fixed corpus, scored with SSIM against the originals.

What the quality dial actually does

103050759501234mozjpeg quality settingBits per pixelPhotographsInterfaceText and tablesGraphics
What the setting costs: mean bits per pixel by quality, per corpus category. The photograph curve bends upward hard after 85.
10305075950.700.800.901.00mozjpeg quality settingSSIM against the originalPhotographsInterfaceText and tablesGraphics
What the setting buys: mean SSIM by quality. Non-photographic content sits near the ceiling at every setting; photographs are where the dial matters.

Two things stand out. The cost curve bends hard after 85: on photographs, each step of the dial above there buys less and costs more, and the last ten points to 95 nearly double the file. And the four content categories barely share a chart. Photographs occupy the whole quality range; interface screenshots, text and graphics sit pinned near the top of the SSIM axis at every setting, because most of their pixels are flat colour that JPEG reproduces easily. Their problem is different, and it is the one SSIM under-reports: ringing around hard edges and smudged text, which is exactly what JPEG’s block transform does to sharp boundaries. A metric averaged over a screenshot full of flat regions barely notices a halo around each letter; your eyes do. That is why the right move for screenshots is not a higher JPEG quality but PNG, which keeps edges exact by construction.

The knee, in numbers

QualityBits per pixelSize, against quality 75SSIM
500.6662%0.8884
600.7772%0.9045
751.07100%0.9315
851.63153%0.9540
953.56333%0.9817

Reading down the photograph table: dropping from 75 to 50 saves about 38% of the bytes and costs 0.043 of SSIM, the largest quality drop in the table. Climbing from 75 to 85 costs half as much again in bytes for a 0.023 gain. Climbing from 85 to 95 more than doubles the file again for 0.028. The steps look symmetrical on the dial and are nothing like it in the files.

Encode time

Time scales with the setting as well as with pixels: on our machine, mozjpeg spent about 88 ms per megapixel at quality 10, 184 at 75 and 482 at 95, single-threaded. This is why a target-size search over a 40-megapixel photo takes real seconds in the compressor: each probe is a full encode of every pixel.

PNG has levels, not qualities

PNG is lossless, so its dial trades time, not fidelity. oxipng’s levels repack the same exact pixels with increasing effort:

oxipng levelMean savingSeconds per megapixel
02.8%0.2
15.4%0.4
2 (this site’s default)8.1%1.0
38.2%3.1
48.5%3.7
58.9%6.0
68.9%7.2

The curve goes flat almost immediately: level 2 captures 8.1% of 8.9% available, and the remaining eight-tenths of a percentage point cost seven times the compute. This site’s compressor runs level 2, and until this table existed that choice was the upstream default taken on trust; it now stands on measurement.

How these numbers were made

One honest caveat belongs next to every chart here: SSIM is computed on luma, as the codec literature does, so chroma artefacts, the colour bleeding JPEG’s subsampling causes around saturated edges, are under-counted. Where that bites, the prose above says so rather than letting the number carry more certainty than it holds.

Download the data

Every number on this page, and the per-image rows behind the means, is free to take:

Licensed CC BY 4.0: use it for anything, credit TabOtter. The photographic corpus is the Kodak PhotoCD test set, released by Kodak for unrestricted use, so results can be compared against the codec literature, which uses the same images.

Limitations

These curves describe one encoder each, at default settings, on a 29-image corpus. They are not claims about Photoshop’s quality scale, which is numbered differently, nor about other JPEG encoders, nor about your particular photograph, which is why the compressor shows you a live preview and measured sizes for your actual image instead of asking you to trust a chart. For choosing between formats rather than within one, the WebP against JPEG comparison is the page with those measurements.

Frequently asked questions

Is JPEG quality 100 lossless?

No. Quality 100 still converts colours, splits the image into blocks and rounds the results; it just rounds gently. It is also poor value, costing far more bytes than 95 for a difference that needs instruments to find. If you need genuinely lossless, that is what PNG is for.

Is the quality number a percentage of something?

No. It is a knob position on the encoder's internal rounding tables, and the scale is not linear: on our corpus, going from 95 down to 75 shed most of the file while SSIM fell by five hundredths, and the same 20-step move from 50 to 30 shed far less while doing more visible damage. Judge settings by their measured effect, not by how far the number is from 100.

Why does the same setting give different sizes on different photos?

Because encoders spend bytes on detail, and images differ in how much they have. At quality 75, the smallest photograph in our corpus cost 0.68 bits per pixel and the busiest 1.81, a factor of 2.7 from the same setting. A quality setting fixes how carefully detail is kept, not how much file that takes.

What quality do the numbers say I should use for the web?

For photographs, the measured knee is between 75 and 85: below 75 the quality falls faster than the file shrinks, and above 85 the file grows faster than the quality improves. 75 is the encoder default and what this site's compressor starts at; 85 is a defensible choice when the image is the point of the page. Above 90 you are paying double for differences you will struggle to point at.

Were these numbers measured with the tools on this site?

Yes, and that is the point of them. The measurements run the same WebAssembly builds of mozjpeg, libwebp and oxipng that this site's compressor executes in your browser, over a fixed, hash-pinned corpus. Numbers measured on some other build would describe software you are not using. The per-image data is downloadable below, CC BY 4.0.