Understanding the MIDI note, frequency and cents calculator — concept and principle
Every MIDI note number corresponds to a pitch in twelve-tone equal temperament, and every pitch has a frequency in hertz. This calculator converts a MIDI note number into its frequency and note name, and it also takes any measured frequency, finds the nearest equal-tempered note and tells you how many cents sharp or flat it is. It helps with tuning, synth setup and MIDI programming.
How it is calculated
- Frequency of note n: f = A4 × 2^((n − 69) / 12), with A4 = 440 Hz by default and note 69 = A4.
- Note name: the pitch class is n mod 12 (0 = C, 9 = A) and the octave is floor(n / 12) − 1, so note 60 is C4 (middle C).
- Nearest note to a frequency f: n = round(69 + 12 × log₂(f / A4)).
- Cents off: 1200 × log₂(f / f_nearest), where f_nearest is that note's exact frequency.
The principle
Pitch perception is roughly logarithmic: going up an octave always doubles the frequency, whatever the starting note. Equal temperament splits each octave into 12 equal ratios, so one semitone is the twelfth root of two, about 1.05946. A cent is a hundredth of a semitone, giving 1200 cents per octave, which turns musical intervals into simple additions. Because the scale is anchored to one reference pitch, changing A4 (to 442 Hz for some orchestras, or 432 Hz by preference) shifts every note by the same ratio.
Worked example
- Inputs: note 69, A4 = 440 Hz, analysed frequency 445 Hz.
- Note frequency: 440 × 2^((69 − 69)/12) = 440 × 1 = 440 Hz.
- Note name: 69 mod 12 = 9 → A; octave floor(69/12) − 1 = 5 − 1 = 4 → A4.
- Nearest note: 69 + 12 × log₂(445/440) = 69 + 0.196 = 69.196 → rounds to 69, which is A4.
- Cents off: 1200 × log₂(445/440) = 19.56 cents sharp.
| MIDI note number (A4 = 69) | Frequency of note (Hz) |
|---|---|
| 17.2 | 22.14424206 |
| 34.5 | 59.9779253 |
| 51.8 | 162.4508761 |
| 69 | 440 |
| 86.2 | 1,191.744881 |
| 104 | 3,227.854232 |
| 138 | 23,679.64305 |
How to read the result
A positive cents value means the frequency is sharp (higher than the note), a negative value means flat. The result always lies between −50 and +50 cents, since beyond that a different note becomes the nearest. Differences of a few cents are hard to hear on a single sustained tone, while about 20 cents, as in the example, is clearly noticeable to most trained listeners when compared with a reference.
Common mistakes
- Octave numbering: some software (for example, certain DAWs) calls note 60 "C3" rather than "C4"; the frequency is the same, only the label differs.
- Using cents with Hz differences: 5 Hz is about 20 cents near 440 Hz but only about 10 cents near 880 Hz.
- Forgetting to change A4 when the ensemble tunes to 442 Hz.
Frequently asked questions
What frequency is middle C?
MIDI note 60 with A4 = 440 Hz is 440 × 2^(−9/12) ≈ 261.63 Hz.
What is the range of MIDI notes?
MIDI note numbers run from 0 to 127; note 0 is about 8.18 Hz and note 127 about 12,543.85 Hz at A4 = 440 Hz.
How do I convert cents back to a frequency ratio?
Ratio = 2^(cents / 1200). For example, +100 cents is 2^(1/12) ≈ 1.0595.
Sources: MIDI Association, MIDI 1.0 Detailed Specification · ISO 16:1975, Acoustics — Standard tuning frequency (standard musical pitch)