JPEG quantization tables

The quality slider does exactly one thing: it scales an 8 × 8 grid of divisors. Those divisors are where every byte saved and every artefact introduced actually come from.

The essentials

What it is
An 8 × 8 grid of divisors, one value per frequency coefficient.
How many
Usually two — one for luma, one shared by both chroma channels.
What it does
Each coefficient is divided by its value and rounded. Rounding is the loss.
Small divisors
Applied to coarse detail. Most of it survives.
Large divisors
Applied to fine detail. Most of it rounds to zero.
The quality setting
Scales the whole table up or down. That is all it does.
Standardised?
No. Encoders use different tables, which is why quality 80 varies.

How the table works

Where it sits in the pipeline

JPEG splits the image into 8 × 8 blocks and transforms each one into 64 coefficients describing how much of each wave pattern the block contains — from flat, through gentle gradients, to fine alternating detail. That transform is fully reversible and loses nothing.

Then quantization: each of the 64 coefficients is divided by the value in the corresponding position of the table, and the result is rounded to a whole number.

The rounding is irreversible, and it is the entire lossy component of JPEG. Everything after it — the zig-zag reordering and the entropy coding — is lossless packing.

Why the values are not uniform

The table is not a single number because not all detail is equally noticeable.

The top-left position holds the DC coefficient — the block's average brightness — which matters enormously, so it gets a small divisor and survives almost intact. Values increase as you move down and right, toward the finest detail, which the eye barely registers.

At the bottom-right, divisors are large enough that almost everything rounds to zero. Zeros cost virtually nothing to store once run-length and entropy coded, which is where the compression comes from: the encoder is not shrinking the data so much as deliberately creating long runs of nothing.

The chroma table is more aggressive throughout, for the same reason chroma is subsampled — colour detail is less visible than brightness detail.

What the quality slider actually does

It scales the table. A high quality multiplies every divisor down toward 1, so little rounds to zero and little is lost. A low quality multiplies them up, so most of the fine coefficients vanish.

This is why the number is not a percentage of anything. It is an index into how aggressively the division is performed, and the relationship to file size is steep and non-linear: the first ten points below 100 cost almost nothing visible and save enormously, while the points below 70 cost visible quality for progressively less.

Why quality 80 differs between tools

The JPEG standard includes example tables in its Annex K, but does not require them. Encoders are free to use their own, and the good ones do.

MozJPEG, for instance, uses tables tuned against perceptual metrics rather than the 1992 originals, which is a large part of why it produces smaller files than most encoders at matched visual quality. Camera manufacturers use their own. Browser canvas implementations use theirs.

So quality 80 in Photoshop, quality 80 in a browser and quality 80 in MozJPEG are three different sets of divisors producing three different files. The ranges are broadly comparable and the numbers are not interchangeable — which is worth remembering whenever someone quotes an exact setting.

Reading the tables in a real file

The quantization tables are stored in the file itself, in a DQT marker, because the decoder needs them to reverse the division. That means they can be read back out.

Tools such as JPEGsnoop or ExifTool will show them, and analysts use the fingerprint to identify which software produced a file — cameras, editors and social platforms each leave recognisable tables. It is also how you can tell that an image has been re-saved by something other than the device that took it.

Try it yourself

Everything below runs in your browser, so you can test any of this on your own files without uploading them.

  • Compress JPEG

    Shrink JPG and JPEG photographs with a quality slider or an exact target size.

    Open the tool
  • Compress WebP

    Re-encode existing WebP files, or convert JPEG and PNG into WebP.

    Open the tool
  • JPG to WebP

    Typically 25–35% smaller at matched quality. The standard web win.

    Open the tool

Questions

Frequently asked questions

Every answer below is present in the page source, expanded, so it can be read without opening anything.

What is a JPEG quantization table?

An 8 × 8 grid of divisors, one for each frequency coefficient in a block. Each coefficient is divided by its value and rounded, and that rounding is the entire lossy step in JPEG encoding.

Does the quality setting change the table?

Yes — that is all it does. A higher quality scales every divisor down so less rounds to zero; a lower quality scales them up so more does. The number is an index into that scaling, not a percentage of anything.

Why do different tools give different results at the same quality?

Because the tables are not standardised. The specification includes example tables but does not require them, so encoders use their own — MozJPEG's are tuned against perceptual metrics, cameras use proprietary ones, browsers use theirs. Quality 80 means different divisors in each.

Can I use custom quantization tables?

Not through a browser, which offers only a quality number. Command-line encoders such as cjpeg and MozJPEG accept custom tables directly, which is how people tune output for specific content.

Why do JPEG artifacts look like squares?

Because quantization is applied to each 8 × 8 block independently. At aggressive settings, so few coefficients survive in each block that its average colour drifts from its neighbours, and the block boundaries stop lining up — which you see as a grid.

Do WebP and AVIF use quantization tables?

They quantise, but not with fixed 8 × 8 tables. Both use variable block sizes and predict each block from its neighbours before quantising the difference, which is a large part of why they achieve the same visual quality in fewer bytes.

From the blog

Related reading

Longer, more practical guides from the blog.

  • Image Compression

    JPEG Quality Settings Explained: What the Number Actually Means

    Quality 80 is not 80% of anything. It is an index into a quantisation table. Measured on one photograph: dropping from 100 to 90 removes 77% of the file and 4.2 dB of fidelity; dropping from 40 to 30 removes 17% and costs almost as much.

    8 min read

  • Image Formats

    WebP vs JPEG: Which Should You Use, and When JPEG Still Wins

    WebP produced a 27.0 KB file against MozJPEG's 41.1 KB on the same photograph at slightly higher measured fidelity — 34% smaller. It also produced a larger file than JPEG on random noise. The advantage is real and content-dependent.

    9 min read

  • Practical Guides

    How to Compress Images for a Website Without Wrecking Them

    Resize before you compress. Measured on one photograph: half the width at quality 80 produced a 16.4 KB file, while full width at quality 40 produced 20.6 KB and looked far worse. The order of operations matters more than the settings.

    8 min read