Understanding Musical Intervals
A musical interval is the distance in pitch between two notes. This calculator uses 12-tone equal temperament (12-TET) — the tuning system behind virtually every modern piano, guitar, and fretted instrument — where an octave is divided into 12 equal semitones and each semitone is a frequency ratio of 21/12 ≈ 1.05946.
The formula
Each note and octave (using scientific pitch notation, where middle C is C4) is converted to a MIDI-style note number n, where A4 = 69. From there the calculator finds the interval three equivalent ways:
- Semitones: the difference between the two notes' positions on the 12-note chromatic scale — every half step, counting both black and white piano keys.
- Frequency ratio: f₂ ÷ f₁, where each note's frequency is f = A4 × 2(n − 69) / 12, with A4 the concert-pitch reference (440 Hz by default).
- Cents: 1200 × log₂(f₂ ÷ f₁). A cent is 1/100 of a semitone, so 100 cents = 1 semitone and 1200 cents = 1 octave.
Naming the interval
The semitone count, reduced to within one octave (0–11), maps to a standard interval name: 0 = unison, 1 = minor 2nd, 2 = major 2nd, 3 = minor 3rd, 4 = major 3rd, 5 = perfect 4th, 6 = tritone, 7 = perfect 5th, 8 = minor 6th, 9 = major 6th, 10 = minor 7th, 11 = major 7th, and 12 = octave. Intervals larger than an octave (compound intervals, like a 10th or 12th) are named by their remainder plus the number of extra octaves — for example, 19 semitones is a perfect 5th plus one octave.
Consonance and dissonance
In common-practice tonal theory, unisons, octaves, perfect fifths, and thirds and sixths are generally treated as consonant (stable-sounding), while seconds, sevenths, and the tritone are treated as dissonant (tense, wanting resolution). This is a long-standing convention, not a physical law — perceived consonance also depends on timbre, voicing, and musical context.