In musical tuning, the Pythagorean comma (or ditonic comma^{[1]}), named after the ancient mathematician and philosopher Pythagoras, is the small interval (or comma) existing in Pythagorean tuning between two enharmonically equivalent notes such as C and B♯ (Play (help·info)), or D♭ and C♯.^{[2]} It is equal to the frequency ratio (1.5)^{12}/128 = about 1.01364, or about 23.46 cents, roughly a quarter of a semitone (in between 75:74 and 74:73^{[3]}). The comma which musical temperaments often refer to tempering is the Pythagorean comma.^{[4]}
The Pythagorean comma can be also defined as the difference between a Pythagorean apotome and a Pythagorean limma^{[5]} (i.e., between a chromatic and a diatonic semitone, as determined in Pythagorean tuning), or the difference between twelve just perfect fifths and seven octaves, or the difference between three Pythagorean ditones and one octave (this is the reason why the Pythagorean comma is also called a ditonic comma).
The diminished second, in Pythagorean tuning, is defined as the difference between limma and apotome. It coincides therefore with the opposite of a Pythagorean comma, and can be viewed as a descending Pythagorean comma (e.g. from C♯ to D♭), equal to about −23.46 cents.
As described in the introduction, the Pythagorean comma may be derived in multiple ways:
A just perfect fifth has a frequency ratio of 3:2. It is used in Pythagorean tuning, together with the octave, as a yardstick to define, with respect to a given initial note, the frequency ratio of any other note.
Apotome and limma are the two kinds of semitones defined in Pythagorean tuning. Namely, the apotome (about 113.69 cents, e.g. from C to C♯) is the chromatic semitone, or augmented unison (A1), while the limma (about 90.23 cents, e.g. from C to D♭) is the diatonic semitone, or minor second (m2).
A ditone (or major third) is an interval formed by two major tones. In Pythagorean tuning, a major tone has a size of about 203.9 cents (frequency ratio 9:8), thus a Pythagorean ditone is about 407.8 cents.
The size of a Pythagorean comma, measured in cents, is
or more exactly, in terms of frequency ratios:
The Pythagorean comma can also be thought of as the discrepancy between twelve justly tuned perfect fifths (ratio 3:2) (play (help·info)) and seven octaves (ratio 2:1):


In the following table of musical scales in the circle of fifths, the Pythagorean comma is visible as the small interval between e.g. F♯ and G♭.
The 6♭ and the 6♯ scales* are not identical  even though they are on the piano keyboard  but the ♭ scales are one Pythagorean comma lower. Disregarding this difference leads to enharmonic change.
* The 7♭ and 5♯, respectively 5♭ and 7♯ scales differ in the same way by one Pythagorean comma. Scales with seven accidentals are seldom used, because the enharmonic scales with five accidentals are treated as equivalent.
This interval has serious implications for the various tuning schemes of the chromatic scale, because in Western music, 12 perfect fifths and seven octaves are treated as the same interval. Equal temperament, today the most common tuning system used in the West, reconciled this by flattening each fifth by a twelfth of a Pythagorean comma (approximately 2 cents), thus producing perfect octaves.
Another way to express this is that the just fifth has a frequency ratio (compared to the tonic) of 3:2 or 1.5 to 1, whereas the seventh semitone (based on 12 equal logarithmic divisions of an octave) is the seventh power of the twelfth root of two or 1.4983... to 1, which is not quite the same (out by about 0.1%). Take the just fifth to the twelfth power, then subtract seven octaves, and you get the Pythagorean comma (about 1.4% difference).
The first to mention the comma's proportion of 531441:524288 was Euclid, who takes as a basis the whole tone of Pythagorean tuning with the ratio of 9:8, the octave with the ratio of 2:1, and a number A = 262144. He concludes that raising this number by six whole tones yields a value G which is larger than that yielded by raising it by an octave (two times A). He gives G to be 531441.^{[6]} The necessary calculations read:
Calculation of G:
Calculation of the double of A:
Chinese mathematicians had been aware of the Pythagorean comma as early as 122 BC (its calculation is detailed in the Huainanzi), and circa 50 BC, Ching Fang discovered that if the cycle of perfect fifths were continued beyond 12 all the way to 53, the difference between this 53rd pitch and the starting pitch would be much smaller than the Pythagorean comma. This much smaller interval was later named Mercator's comma (see: history of 53 equal temperament).
In George Russell's Lydian Chromatic Concept of Tonal Organization (1953) the half step between the Lydian Tonic and ♭2 in his Altered Major and Minor Auxiliary Diminished Blues scales is theoretically based on the interval of a Pythagorean comma.^{[7]}