What Is the Semitone Calculator?
This tool measures the musical interval between two pitches expressed in semitones — the smallest step in the 12-tone equal temperament system used by pianos, guitars, and most Western music. Given any two frequencies (in Hz), it returns how many semitones (and cents) separate them.
How to Use It
Enter the lower frequency f1 and the higher frequency f2 in hertz, then read the interval. A positive value means f2 is higher than f1; if you reverse the order you get a negative number, indicating a downward interval. The result also converts to cents, where 100 cents equals one semitone.
The Formula Explained
The interval in semitones is:
$$n = 12 \cdot \log_{2}\!\left(\frac{\text{Higher } f_2 \text{ (Hz)}}{\text{Lower } f_1 \text{ (Hz)}}\right)$$
An octave doubles the frequency (\(f_2/f_1 = 2\)), and \(\log_{2}(2) = 1\), so \(12 \times 1 = 12\) semitones — exactly one octave. Each semitone corresponds to a frequency ratio of the twelfth root of two (\(\approx 1.0595\)).
Worked Example
Compare A4 (440 Hz) with A5 (880 Hz). The ratio is \(880/440 = 2\), and \(\log_{2}(2) = 1\), so $$n = 12 \times 1 = 12 \text{ semitones}$$ — one full octave, or 1200 cents.
FAQ
What is a semitone? It is the interval between two adjacent keys on a piano, such as C to C#.
What are cents? Cents subdivide each semitone into 100 equal parts, useful for measuring tuning accuracy.
Can I get a negative result? Yes — if f2 is lower than f1, the interval is negative, meaning a downward pitch change.