You can play piano with your computer keyboard in any free browser piano that supports it, and the layout is easier to learn than it looks. The middle row of letters becomes a row of white keys, the row above it fills in the black keys, and two more keys move you up and down the instrument. Within a minute you can play a scale. Within ten you can play a tune.
This guide gives the full key chart for the Songscription virtual piano, explains how to reach the rest of the 88 keys, and covers the limits of typing on a piano so you know when it is worth moving to real keys.
The short answer
Open the virtual piano on a computer and press A. That is middle C. The keys along the same row, S D F G H J K L ; ', play the white keys going up. The row above, W E T Y U O P, plays the black keys between them. Press Z to move everything an octave down and X to move it an octave up. Hold Space to sustain.
To see which computer key plays which note, open the options menu next to Sustain and switch on Show computer keys. Each piano key then shows the letter that plays it.
Computer keyboard piano chart
This is the layout when the page opens, with A on middle C. It covers 18 notes, from middle C to the F an octave and a half above it.
Computer keys mapped to piano notes on the Songscription virtual piano, US QWERTY layout, starting from middle C
| Computer key | Piano note | Key color |
|---|---|---|
| A | C4 (middle C) | White |
| W | C♯4 / D♭4 | Black |
| S | D4 | White |
| E | D♯4 / E♭4 | Black |
| D | E4 | White |
| F | F4 | White |
| T | F♯4 / G♭4 | Black |
| G | G4 | White |
| Y | G♯4 / A♭4 | Black |
| H | A4 | White |
| U | A♯4 / B♭4 | Black |
| J | B4 | White |
| K | C5 | White |
| O | C♯5 / D♭5 | Black |
| L | D5 | White |
| P | D♯5 / E♭5 | Black |
| ; | E5 | White |
| ' | F5 | White |
Two keys in the top row, R and I, make no sound. They sit above the gaps between E and F and between B and C, where a real piano has no black key either. Keeping them silent means the top row looks like a piano’s black keys, in groups of two and three. Q and [ are silent at the start for the same reason.
If the sharps and flats in the chart are new to you, each black key has two names, one from the white key below and one from the white key above. Our guide to enharmonic notes explains why, and our piano notes chart labels all 88 keys.
How do you change octaves?
Eighteen notes cover most simple melodies, but a piano has 88 keys. Press Z or X to move every computer key an octave, or the arrow keys to move half an octave. In detail:
- Z and X move every computer key one octave down or up. After pressing X once, A plays C5 instead of C4.
- The left and right arrow keys move the keys half an octave, to the next C or F, which helps when a melody sits across the edge of the mapped range.
- The on-screen arrows beside the keyboard move the keys on screen and the computer keys together.
The keys on screen follow the mapping, so you can always see which part of the piano your letters are playing. The mapping stops at the ends of the instrument. It will not move a key past the lowest A or the highest C.
Sustain, chords and playing tips
Sustain. Hold Space and notes keep ringing after you let go of their keys, like a piano’s sustain pedal. Lift Space to stop them. This makes a melody sound connected even when your fingers jump between keys.
Chords. Press keys together for chords. A, D and G play C major. S, F and H play D minor. G, J and L play G major. Our guide to chords shows how to build the rest from the same pattern.
Hand position. Rest your left fingers on A S D F and your right fingers on J K L ;, as if you were typing. Most simple melodies then sit under your fingers without moving your hands.
Scales. Play A S D F G H J K for a C major scale. It is the quickest way to learn the layout, and it is the same scale beginners start with on a real piano. Our explainer on what a scale is covers the others.
Other layouts. The virtual piano reads key positions, not letters. On an AZERTY or Dvorak keyboard, the same physical keys play the same notes, even though their letters differ from the chart.
A first tune to try
“Ode to Joy” fits inside the starting layout. Play it slowly, one key per beat:
D D F G G F D S A A S D D S S
D D F G G F D S A A S D S A A
That is the melody’s first two lines, with A as middle C. Once it feels comfortable, hold Space between phrases and listen to the notes ring together. For more songs, our guide to playing piano online with songs covers where to find the notes.
What are the limits of a computer keyboard piano?
A computer keyboard is a good way to try piano and to pick out melodies, but it has real limits.
- No dynamics. Every key press plays at the same volume. A piano’s keys play louder the harder you press them, and that control is much of what makes playing sound musical.
- Too many keys at once. Many computer keyboards stop reporting presses when too many keys are held down, so a big chord can lose a note. It depends on the keyboard, not the piano page.
- Different finger habits. Typing uses a flat, quick tap. Piano uses curved fingers and weight from the arm. Long sessions of typing a song can build habits you later have to undo at real keys.
- No guidance. The page plays what you press. It does not show you a song or tell you when a note is wrong.
When to move to real keys
Move to a real keyboard when you find yourself wanting to play with both hands, play louder and softer, or learn complete songs rather than melodies. A small keyboard is enough to start. Our guide on how many keys you need covers sizes.
A real keyboard also plugs straight into the virtual piano. Connect it with USB, open the options menu and choose Connect MIDI keyboard, and the page then follows how hard you play and your sustain pedal. This works in Chrome or Edge on a computer or Android phone, and in Firefox on a computer.
For learning songs on that keyboard, the Anything Piano app turns any song, from an audio file or a YouTube link, into a piano roll of falling notes, rather than sheet music. You can slow it down, loop a hard section, practice one hand at a time, and it listens as you play, through a MIDI connection or your device’s microphone on an acoustic or digital piano. It runs on iPhone and iPad, with a waitlist for Android.
Frequently asked questions
Can you play piano with a computer keyboard?
Yes. A browser piano such as the Songscription virtual piano maps your letter keys to piano keys. The middle row from A plays the white keys from middle C up to the F above the next C, and W, E, T, Y, U, O and P play the black keys. Z and X move all of them an octave down or up.
Which computer key is middle C?
A. On the Songscription virtual piano, A plays middle C (C4) when the page opens, S plays D, D plays E, and so on along the row. Press Z or X to move the whole row an octave, and A then plays the C in that octave.
How do I play black keys on a computer keyboard?
Use the row above the letters you are playing. W is C sharp, E is D sharp, T is F sharp, Y is G sharp, U is A sharp, O is C sharp an octave up, and P is D sharp. R and I sit where a piano has no black key, so they make no sound.
Can I play chords on a computer keyboard piano?
Yes, press several keys together. A, D and G play a C major chord. Some computer keyboards stop reporting keys when too many are held at once, so a large chord may drop a note. That is a limit of the keyboard hardware, not the piano.
Does the computer keyboard piano work on AZERTY or other layouts?
Yes. The Songscription virtual piano reads key positions rather than letters, so on an AZERTY or Dvorak keyboard the same physical keys play the same notes. The key labels in this guide are for a US QWERTY keyboard.
Final thoughts
Typing on a piano is one of those small pieces of magic that the web made ordinary. It takes the most familiar object on your desk and turns it into an instrument, and the layout is simple enough that a scale comes out within a minute.
Treat it as an invitation rather than a destination. If an evening of tapping out melodies on A S D F leaves you wanting more, that wanting is the useful part. It means the next step is a set of real keys under your hands, where the same notes are waiting.
