Online Piano Keyboard
Play an 18-key piano from C4 to F5 with your computer keyboard or mouse, follow seven simple songs note by note, and record what you play.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Online Piano?
This is a small piano you play with the letter keys. The home row is the white keys: A is middle C (C4), then S, D, F, G, H, J, K, L, semicolon and apostrophe climb up to F5. The row above holds the sharps: W, E, T, Y, U, O and P. You can also click or tap the keys.
Below the keyboard are seven melodies, from Happy Birthday to Auld Lang Syne. Play runs one automatically and lights each key as it sounds. Mount Notes opens a learning view that shows one note at a time, tells you which letter to press, and lets you step forward and back through the tune.
The sound is a plain sine wave from the Web Audio API, so it sounds more like a tuning fork than a grand piano. The range is one and a half octaves, enough for nursery tunes and carols but not for two-handed pieces. Everything, including recording, happens in your browser.
- 18 keys, C4 to F5, tuned to A4 = 440 Hz equal temperament
- Computer keyboard, mouse and touch input
- Seven built-in songs with auto-play and a note-by-note learning view
- Record and download what you play
- Volume slider and mute; runs in your browser with no plugins
Updated
How to use the Online Piano
- Click anywhere on the page once so the browser allows sound, then press A, S, D, F to hear C, D, E, F.
- Use W, E, T, Y, U, O and P for the black keys (sharps). Holding a key plays it once; press again to repeat it.
- Under Popular Songs, press the play button next to a song to hear it, or Mount Notes to learn it one note at a time with Previous and Next.
- Set the volume with the slider or mute with the speaker button.
- Press Record, play something, press Stop, then Download to save the take as an audio file.
Worked examples
First line of Happy Birthday
Input
A A S A F D
Output
C4 C4 D4 C4 F4 E4
The song is written in F major starting on middle C, so the first phrase sits entirely on the home row. The second phrase is A A S A G F (C C D C G F).
Mary Had a Little Lamb
Input
D S A S D D D, S S S, D G G
Output
E4 D4 C4 D4 E4 E4 E4, D4 D4 D4, E4 G4 G4
Only four keys are needed for the whole tune, which makes it the easiest first song on a computer keyboard.
Background and insight
Each key is tuned in twelve-tone equal temperament with A4 at 440 Hz, the concert pitch fixed by ISO 16. Every semitone multiplies the frequency by the twelfth root of 2 (about 1.05946), so C4 comes out at 261.63 Hz and C5, one octave up, at exactly double that: 523.25 Hz. Note names follow scientific pitch notation, where the number counts octaves and middle C is C4.
The letter layout is the "musical typing" arrangement used by GarageBand, Ableton Live and most DAWs. It works because a QWERTY row has the same pattern of gaps as a piano: there is no black key between E and F, and there is no letter between E and T on the row above that the layout needs. Browsers will not start audio until you interact with the page, so the audio engine is created on your first key press or click rather than on page load.
Common use cases
Picking out a melody
Find the notes of a tune you are humming without reaching for an instrument.
A first music lesson
Kids can learn note names and simple songs with the step-by-step Mount Notes view.
Checking a pitch
Play A4 (the H key) at 440 Hz as a quick reference while tuning a guitar or ukulele by ear.
Recording a short jingle
Record a few bars and download the file for a video, a ringtone test or a voice memo.
Tips and limitations
- If nothing sounds, click the page once. Browsers block audio until the first user gesture, and a muted tab or OS volume also silences it.
- Key presses are ignored while Ctrl, Cmd or Alt is held, so browser shortcuts like Cmd+S do not play a D.
- Recordings save as WebM in Chrome and Firefox and MP4 in Safari, depending on what MediaRecorder supports.
- Black-key positions are set when the page loads. If you rotate a phone, reload so the sharps line up.
- The range stops at F5, so songs that go higher have been transposed to fit (Amazing Grace is in F major here).
Sources and further reading
- ISO 16:1975 Acoustics: Standard tuning frequency (Standard musical pitch), International Organization for Standardization. A4 = 440 Hz
- Note names, MIDI numbers and frequencies, UNSW Sydney. Equal-temperament frequencies by note
- Autoplay guide for media and Web Audio APIs, MDN Web Docs. Why audio waits for the first key press or click
Frequently asked questions
How do I play the online piano with my computer keyboard?
Use the home row for white keys: A is middle C, then S, D, F, G, H, J, K, L, ; and ' go up to F5. The row above (W, E, T, Y, U, O, P) plays the sharps. Click the page once first so the browser lets it make sound.
Which key is middle C on this virtual piano?
The A key is middle C, written C4 in scientific pitch notation, at 261.63 Hz. The K key is the C an octave above it (C5, 523.25 Hz).
Why is there no sound when I press the piano keys?
Browsers will not start Web Audio until you click, tap or press a key on the page, so the very first gesture unlocks sound. If it is still silent, check that the tab is not muted, the volume slider is above zero and the mute button is off.
Is the online piano tuned correctly?
It uses twelve-tone equal temperament with A4 at 440 Hz, the standard concert pitch. Each semitone is the previous frequency times 2^(1/12), so the pitches match a piano tuned to that standard to within a hundredth of a hertz.
Can I record what I play on the online piano?
Press Record, play, then press Stop and a Download button appears. The recording captures the piano audio directly, not your microphone, and saves as WebM or MP4 depending on your browser.
Why can I not hold a key down to sustain a note?
Each press plays a short note with a fixed fade-out of about 0.3 seconds, and auto-repeat from a held key is ignored. Press the key again to repeat a note.
Is there an in-depth guide to the Online Piano?
Yes. “Playing Piano on a Computer Keyboard: Note Names, Keys and First Songs” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.