This virtual piano runs in your browser on a computer, tablet, or phone. Play it with your computer keyboard, a mouse, or your fingers, pick a grand piano, electric piano, or organ, follow six easy songs key by key, and record what you play. There's nothing to install.
How the virtual piano keyboard works
The keys follow a real piano: white keys for the notes A to G, and black keys in groups of two and three for the sharps and flats in between. The piano shows as many keys as fit your screen, about three octaves on a wide display and fewer on a phone, and the octave buttons slide the view. They reach all 88 keys, and the computer keys play C1 to C8.
The display above the keys names the sound and the notes the computer keys cover, such as Keys C3–G5. Play one note and it shows its name and pitch, so A4 reads 440 Hz. Hold two or more and it names the chord: C, Am7, or G/B when the B is in the bass.
Play the virtual piano with your computer keyboard
On the bottom letter row, Z X C V B N M are the white keys from C to B, and S D G H J on the row above are the black keys between them. The top letter row starts the next octave: Q W E R T Y U are white keys again, with their black keys on the number row, 2 3 5 6 7. Both rows carry on past the octave, to / below and ] above, so together they cover 32 notes, from C up to the G two octaves higher.
- ← and → move the computer keys an octave, from octave 1 to 6. At the default, octave 3, Z plays C3 and Q plays middle C.
- Space is the sustain pedal while you hold it.
- Set Labels on the keys to Keyboard to see which key plays each note. The piano reads key positions, not letters, so on layouts such as AZERTY the same spots play the same notes, and browsers that share the layout label them with your letters.
Typing in a text box never plays a note.
Grand piano, electric piano, and organ sounds
Piano is a grand piano. Low notes ring for several seconds and fade slowly, high notes are short and bright, and each note starts with a soft hammer thump. Low notes sit to the left and high notes to the right, the way you hear them from the bench.
Electric is an electric piano with a bell-like tone: a little bark as the key goes down that mellows as it fades. Organ holds every note at full level for as long as you keep the key down, with a gentle vibrato and a short percussive ping at the start.
The sustain pedal and the top keys
On an acoustic piano, felt dampers stop a string as soon as you let go of its key, unless the sustain pedal holds them off. This piano works the same way. Hold Space, or press Sustain to latch it on, and notes you release keep ringing until the pedal lifts. The keys from F6 to the top have no dampers, as on a real piano, so they ring on after you let go even without the pedal.
Up to 40 notes can sound at once; past that, the oldest fades out.
Six easy songs, one key at a time
Pick a tune under Learn a song and press Start. The next key glows amber, and the piano moves to show it. Play it and the next one lights up. There's no clock, so you can take each note at your own pace, and a wrong key sounds but doesn't move you on. Press Listen first to hear the tune at its normal speed.
- Twinkle, Twinkle, Little Star: 42 notes
- Mary Had a Little Lamb: 26 notes
- Ode to Joy, from Beethoven's Ninth Symphony: 30 notes
- Happy Birthday: 25 notes
- Jingle Bells: 51 notes
- The opening of Für Elise by Beethoven: 35 notes
Each song is the melody only, for one hand, and stays between G3 and E5, close to middle C.
Record yourself and play it back
Press Record, play, and press Stop. The recorder notes every key you press and release, to the millisecond, along with the sustain pedal, so Play follows your timing. It stops by itself at 10 minutes or 4,000 events, whichever comes first. Each press, release, and pedal change is one event, so that's about 2,000 notes.
There's one saved take. Recording again replaces it, and the eraser button deletes it. Playback uses the sound that's selected now, so you can record on the grand piano and hear the same take on the organ. The Listen demos are never recorded.
Landmarks: C, half steps, and chord shapes
A few landmarks make the keys easier to find:
- Every C sits just left of a group of two black keys, and middle C is C4.
- Each key, white or black, is one half step from the next.
- A minor chord lowers the middle note of a major chord by one half step: C major is Z C B and C minor is Z D B.
- On a touch screen, keep each finger still. Sliding moves the note to the next key.
The four pads in Pattern Echo play C4, E4, G4, and C5, so you can pick out its patterns on these keys too.
How the virtual piano makes its sound
No recorded samples are downloaded: every sound is made in your browser with the Web Audio API. A grand piano note is built from up to 24 overtones, each a fading sine wave. They're tuned slightly sharp, the way stiff piano strings ring, and the lowest six are split into pairs a hair apart, like the paired strings of a real piano, so the tone shimmers. The overtone mix follows where a hammer strikes the string.
To keep start-up quick, the piano renders one note in every three keys and plays its neighbors a semitone higher or lower, the way sampled pianos stretch their recordings. The electric piano uses two-operator FM synthesis, and the organ blends drawbar-style harmonics from 16′ to 1′. Everything passes through a small room reverb and a gentle compressor that keeps big chords from distorting.
Where the piano and its sounds came from
Bartolomeo Cristofori built the first pianos in Florence around 1700. Unlike the harpsichord, which plucks its strings, his instrument struck them with hammers, so it could play soft or loud depending on touch. He called it a harpsichord with soft and loud, which gave us the names pianoforte and piano. A modern concert grand has 88 keys, from A0 to C8.
The electric piano sound has its own story. John Chowning developed FM synthesis at Stanford, Yamaha licensed it, and the DX7 synthesizer of 1983 brought FM electric pianos to a wide audience. This site isn't affiliated with Yamaha.
Touch, mouse, keys, and screen readers
The piano runs in any modern browser on a Windows PC, Mac, Chromebook, iPhone, iPad, or Android device:
- Touch: every finger plays its own key, and sliding along the keys plays a run. Turn a phone sideways to see more keys.
- Mouse: click a key, or hold the button and drag across several.
- Keyboard: the letter rows play notes, the arrows change octave, and Space is the pedal.
- Screen readers: each key has a spoken name, such as C sharp 4, and song prompts are announced.
The page needs a connection to load. After that, every note is synthesized on the device in front of you, from the hammer thump to the room reverb.
Saved on this device: your sound, song, and take
Come back later and the piano still has your sound, key labels, octave, volume, chosen song, and your one recording, because they sit in this browser's local storage under virtual-piano:v1, an entry the privacy policy describes. The notes you play and the take you record aren't sent to a server. Clearing this site's data in your browser settings erases them.
Want a beat to play along with? Open the Virtual Drums, or strum chords on the Virtual Guitar.