A perfect fifth is the ratio 3:2 — but stack twelve of them and you miss the octave by a hair (the Pythagorean comma). Equal temperament spreads that error evenly, so every key is equally, slightly out of tune. Slide the interval, ▶ play it, and hear the compromise.
The twelve-tone equal-tempered scale against just intonation. Each semitone is the irrational ratio 2^(1/12); an interval of n semitones is 2^(n/12). The just intervals are small-integer ratios — fifth 3/2, fourth 4/3, major third 5/4 — and the gap is measured in cents (1200·log₂(ratio)). The octave is exact (2^(12/12)=2); the equal fifth 2^(7/12)=1.4983 misses the just 3/2 by ~2 cents, the equal major third by ~14. Twelve just fifths overshoot seven octaves by the Pythagorean comma, (3/2)¹²/2⁷ ≈ 1.0136 — equal temperament is that error, shared out. A fail-loud self-check throws unless the octave is exact and the equal fifth sits within a few cents of 3/2. Press ▶ to hear the root and the interval together.
Just ratios shown for the nearest simple interval; real tuning systems (meantone, well temperaments) make other trade-offs. The 2^(n/12) ratios and the cents are computed exactly.