Convert Hz to a musical note, with how many cents sharp or flat it is, or pick a note and octave to get its frequency in Hz, using A4 = 440 Hz tuning.

Optional settings

Calculator Functions

FunctionWhat it doesWhat it requires
Note from frequency (Hz)Finds the closest musical note to a frequency and how many cents sharp or flat the frequency isRequires a frequency in Hz
Frequency from noteFinds the frequency of a named noteRequires the note name and its octave, from 0 to 8
Frequency from piano key indexConverts a piano key index into a frequencyRequires the key index, counted from A0 = 1 so that A4 = 49. Fractional values are accepted for pitches between keys

Every function uses 12-tone equal temperament with A4 = 440 Hz and scientific pitch names, where middle C is C4. Each result shows the closest note, the offset from it in cents, the piano key index, the MIDI note number and a table of the twelve note frequencies in that octave.

Hz to Note Formulas

n = 49 + 12 × log2(f ÷ 440) [1]
nPiano key index: A0 = 1, A4 = 49, C8 = 88
fFrequency (Hz)
440Frequency of A4, the reference note (Hz)

In equal temperament an octave doubles the frequency and is split into 12 semitones with the same frequency ratio, 21/12, about 1.0595. The number of semitones between a frequency and A4 is therefore 12 × log2(f ÷ 440) [1]. Adding 49 turns that into a piano key index. Adding 69 instead gives the MIDI note number [1], so the MIDI number is always the key index plus 20.

Note from frequency (Hz)

The main formula gives n, and the closest note is n rounded to the nearest whole key, with an exact half rounding up. The offset in cents is (n − the whole key) × 100, positive when the frequency is sharp. For 450 Hz, n = 49 + 12 × log2(450 ÷ 440) = 49.389, so the closest note is A4 and the frequency is 38.91 cents sharp. For 128 Hz, n = 27.623, which is C3 (130.81 Hz), 37.63 cents flat.

Frequency from note

n = 12 × (octave + 1) +
s − 20

Here s is the number of semitones the note sits above C: C = 0, C♯ = 1, and so on up to B = 11. The key index then goes into the frequency formula below. B4 is 12 × 5 + 11 − 20 = key 51, which is 493.88 Hz.

Frequency from piano key index

f = 440 × 2(n − 49) ÷ 12 [1]

Key 40 is middle C: 440 × 2−9 ÷ 12 = 261.63 Hz. Key 1 (A0) is 27.5 Hz and key 88 (C8) is 4,186.01 Hz.

Note frequencies in Hz

NoteOctave 2Octave 3Octave 4Octave 5
C65.41130.81261.63523.25
C♯/D♭69.30138.59277.18554.37
D73.42146.83293.66587.33
D♯/E♭77.78155.56311.13622.25
E82.41164.81329.63659.26
F87.31174.61349.23698.46
F♯/G♭92.50185.00369.99739.99
G98.00196.00392.00783.99
G♯/A♭103.83207.65415.30830.61
A110.00220.00440.00880.00
A♯/B♭116.54233.08466.16932.33
B123.47246.94493.88987.77

Each octave up doubles the frequency and each octave down halves it, so A1 is 55 Hz and A6 is 1,760 Hz.

Limits of This Estimate

  • The note names assume equal temperament and A4 = 440 Hz. An instrument tuned to another reference pitch, or in another tuning system, gives different frequencies for the same note names [1].
  • The closest note is only a label for the nearest semitone. The cents offset shows how far the frequency really is from that note, up to 50 cents either way.
  • A key index below 1 or above 88 lies outside a standard 88-key piano. The frequency is still calculated, as a theoretical pitch.

Sources

  1. University of New South Wales, Music Acoustics, Note names, MIDI numbers and frequencies: equal-tempered semitone ratio, semitones from A4 as 12 × log2(f ÷ 440), and MIDI number 69 for A4