How this instrument works
Musical pitch perception is logarithmic, not linear: the frequency gap that separates two notes an octave apart doubles every time you go up an octave, but the number of semitones between them (12) stays the same. To measure the semitone distance between two frequencies, you need a formula built on that ratio, not a simple subtraction — twelve times the base-2 logarithm of the frequency ratio between the two notes.
That's what 12 x log2(freq2 / freq1) does: log2 of the ratio tells you how many octaves apart the two frequencies are (as a fraction), and multiplying by 12 converts octaves into semitones, since 12-tone equal temperament divides every octave into exactly 12 equal semitone steps. A ratio of exactly 2:1 always gives 12.0 semitones, whether the starting frequency is 55 Hz or 5,500 Hz.
This instrument is effectively the inverse of this site's note-frequency calculator: instead of starting from a semitone offset and computing a frequency, it starts from two frequencies and computes the semitone offset between them — useful for checking how far a recorded or measured pitch sits from a reference note, or confirming that two tones really are a specific musical interval apart.
- Enter First frequency (Hz) — the reference pitch.
- Enter Second frequency (Hz) — the pitch you're comparing it to.
- Read Interval (semitones) directly beneath the inputs.
- A negative result means the second frequency is lower than the first.
- Both frequencies must be greater than zero for a valid interval to be computed.
Worked example — 440 Hz to 880 Hz
Enter First frequency = 440 Hz and Second frequency = 880 Hz. That's 12 x log2(880/440) = 12 x log2(2) = 12 x 1 = 12.0 semitones. Interval reads 12.0.
880 Hz is exactly double 440 Hz, and a 2:1 frequency ratio is the definition of an octave — so it's no surprise the calculation returns exactly 12.0 semitones, the number of equal steps 12-tone equal temperament divides every octave into.
Questions
Why does doubling the frequency always equal 12 semitones?
Because that's how an octave and 12-tone equal temperament are defined: an octave is a 2:1 frequency ratio, and equal temperament splits every octave into 12 equal semitone steps. Since log2(2) = 1 exactly, the formula's 12 x log2(2) always resolves to 12.0, regardless of which two frequencies form the doubling.
What does a negative result mean?
It means the second frequency is lower than the first — the interval still has the same magnitude, but it points downward rather than upward. A first frequency of 880 Hz and second of 440 Hz, for example, gives -12.0 semitones, the same octave interval measured in the opposite direction.
Can I use this to check if two notes are actually in tune with each other?
Yes. If two pitches are supposed to be a clean interval apart — say, exactly one semitone — this instrument will show how close the real-world frequencies come to that ideal. 440 Hz compared with 466.16 Hz, for instance, returns approximately 0.9999 semitones — confirming those two frequencies really are essentially one semitone apart.
Is this the same math a guitar or chromatic tuner uses?
Yes — chromatic tuners detect a note's frequency and then use this same logarithmic formula to compute how many cents or semitones sharp or flat it is relative to the nearest standard pitch, which is what drives the tuner's needle or LED display.
How is this different from the interval-name calculator on this site?
This instrument gives you a precise numeric semitone count, which can include fractions of a semitone for slightly out-of-tune pitches. This site's interval calculator instead takes a whole-number semitone count and returns the standard music-theory name for that interval, such as 'Perfect 5th' for 7 semitones.