About the Virtual Piano
Play a full-size-feel piano keyboard right in your browser. Click or tap the keys, or use your computer keyboard — the A, S, D, F… row plays the white keys and W, E, T, Y, U… play the black keys — and shift octaves to reach the whole range. Each note shows its name and frequency as you play, which makes it a handy reference when you are learning notes, working out a melody by ear or checking a chord.
Below the keyboard, the key lookup tells you everything about any note on a standard 88-key piano: its key number (A0 is key 1, middle C is key 40, C8 is key 88), MIDI number, frequency, whether it is a white or black key, and its enharmonic name.
Sound is generated with the Web Audio API in equal temperament from A4 = 440 Hz, so there is nothing to download. Some phones mute web audio when the silent switch is on.
With the default inputs, the frequency is 261.63 Hz. Change any value above to recalculate instantly.
How to use the virtual piano
- 1Click or tap a key on the virtual piano to hear it.
- 2Or click the keyboard area and use A S D F G H J K for white keys and W E T Y U for black keys.
- 3Press Z / X (or the octave buttons) to move down or up an octave.
- 4Type any note into the lookup to see its key number, MIDI number and frequency.
Formula and method
A standard piano has 88 keys from A0 (key 1, 27.5 Hz) to C8 (key 88, 4186.01 Hz). In equal temperament every key is a semitone above the previous one, multiplying the frequency by the twelfth root of 2 (≈ 1.0595), so twelve keys up doubles the frequency. Key 49 is A4, the 440 Hz tuning reference.
MIDI note numbers run 20 higher than piano key numbers (A0 = MIDI 21, middle C = MIDI 60 = key 40). The five black keys in each octave are C♯/D♭, D♯/E♭, F♯/G♭, G♯/A♭ and A♯/B♭; each has a sharp and a flat name.
- f
- Frequency in hertz
- n
- Piano key number (A0 = 1, A4 = 49, C8 = 88)
- A4
- Tuning reference, normally 440 Hz
Worked examples
Middle C
Middle C (C4) is the 40th key on an 88-key piano and MIDI note 60. It sits 9 semitones below A4, so its frequency is 440 × 2^(−9/12) = 261.63 Hz.
A4 tuning note
A4 is key 49 and the international tuning reference of 440 Hz — the note an orchestra tunes to.
B♭2 black key
B♭2 is a black key, also called A♯2. It is key 26 (MIDI 46), 23 semitones below A4: 440 × 2^(−23/12) ≈ 116.54 Hz.
Top and bottom of the piano
C8, the highest key, is key 88 at about 4186 Hz; the lowest key, A0, is 27.5 Hz — a range of just over seven octaves.
Frequently asked questions
How do I play the virtual piano with my computer keyboard?+
Click on the piano first, then use the middle letter row: A = C, W = C♯, S = D, E = D♯, D = E, F = F, T = F♯, G = G, Y = G♯, H = A, U = A♯, J = B and K = the next C. Z and X shift down or up an octave.
Which key is middle C?+
Middle C is C4, the 40th key from the left on an 88-key piano, MIDI note 60, at 261.63 Hz. On the virtual piano it is labelled C4.
How many keys does a piano have?+
A standard modern piano has 88 keys — 52 white and 36 black — spanning A0 (27.5 Hz) to C8 (4186 Hz). Many keyboards and digital pianos have 61 or 76 keys.
Why is there no sound?+
Browsers only start audio after you interact with the page, so press a key or click first. On iPhone, the silent switch can mute web audio; turn it off or use headphones. Also check the volume slider.
What are the frequencies of piano keys?+
Each key is 2^(1/12) times the one below. A0 = 27.5 Hz, A1 = 55 Hz, A2 = 110 Hz, A3 = 220 Hz, A4 = 440 Hz, A5 = 880 Hz, and so on — every A is double the previous one.