Online Piano: Play a Virtual Piano Keyboard

A free online piano you can play with your mouse, touch screen or computer keyboard. Turn on note names, hold notes with sustain, record and play back what you play, and learn easy songs key by key.

Free, no sign-up, nothing to download.

Piano

Ready
C3–C7

Computer keys: A S D F G H J K L play the white keys from C, W E T Y U O P the black keys; Z and X change the octave; hold Space for sustain.

Record

No recording yet. Press Record and play.

Easy songs

Learn highlights the next key and waits for you to play it.

Note names

How to play the online piano

  1. Turn your volume up and play a key: click it, tap it, or press a letter on your computer keyboard. The first key also switches the sound on, as browsers keep audio off until you interact with the page.
  2. Use the arrows next to the note range (or Z and X) to move the keyboard down or up an octave. Phones show two octaves, wider screens up to five.
  3. Press Sustain to let notes ring on after you let go, like holding a piano's right pedal down. For pedalling by hand, hold Pedal (or the Space bar) and let go to stop the sound, just as you would lift your foot.
  4. Choose Note names: Off, letter names (C D E) or Do Re Mi. Switch Show computer keys on to see which letter plays which key.
  5. To record, press Record, play, and press Stop recording (or Stop). Play plays it back, Clear deletes it.
  6. To learn a song, pick one under Easy songs and press Learn. The next key glows and the piano waits until you play it. Listen plays the tune first so you know how it goes.

On a touch screen you can play chords with several fingers and slide along the keys for a glissando. With a mouse or a finger, a key sounds louder the nearer its front edge you strike it. To keep steady time, practise with the online metronome in another tab.

Keyboard shortcuts

The home row plays the white keys and the row above plays the black keys between them. A always plays a C; Z and X move it down or up an octave.

Computer keyPiano key
A S D F G H JC D E F G A B (white keys)
W E · T Y UC♯ D♯ · F♯ G♯ A♯ (black keys)
K L ; 'C D E F of the next octave
O PC♯ D♯ of the next octave
Z / XOctave down / up
Space (hold)Sustain pedal

Keys are matched by position, so on a QWERTZ or AZERTY keyboard the same physical keys play the same notes, and where the browser can tell, the piano shows your layout's letters. Many computer keyboards cannot report more than a few keys held at once, so big chords may drop a note.

How piano notes are named

Western music uses twelve notes that repeat in every octave. The seven white keys are named C, D, E, F, G, A and B (or Do, Re, Mi, Fa, Sol, La and Si in the fixed-do system used in much of Europe and Latin America, where Do is always C). The five black keys are sharps or flats of their neighbours: the black key just above C is C♯ (C sharp), the same key as D♭ (D flat). The keyboard names black keys with sharps; the songs use the spelling of the music, such as B♭ in Frère Jacques.

Black keys come in groups of two and three, and C is always the white key just to the left of a group of two. Each octave is numbered, and the number goes up at every C, so the keys run B3, C4, D4. Middle C, near the middle of a full 88-key piano, is C4, marked with a dot here. The A above it, A4, is the tuning note at 440 Hz. The notes are tuned in equal temperament, where every semitone step multiplies the frequency by the twelfth root of two (about 1.0595), so middle C sounds at about 261.63 Hz and the lowest A of a piano, A0, at 27.5 Hz.

How to read the easy songs

When you press Learn, the tune appears above the keyboard as a row of note names, read from left to right; each new line is a phrase. The highlighted name is the next note, and the matching key glows on the keyboard. Wider boxes are longer notes (held for two or four beats) and narrow boxes are short, quick notes; press Listen to hear the rhythm. All songs here are traditional or classical melodies in the public domain: Twinkle Twinkle Little Star, Mary Had a Little Lamb, Beethoven's Ode to Joy, Frère Jacques, the chorus of Jingle Bells (1857) and the opening of Für Elise. Twinkle Twinkle, Mary Had a Little Lamb, Ode to Joy and Jingle Bells use only white keys between middle C and the A above it, which makes them good first tunes; Frère Jacques adds one black key (B♭) and Für Elise two (D♯ and G♯).

How the sound works, and its limits

There are no recordings to download: each note is built live in your browser with the Web Audio API. A piano string vibrates at many frequencies at once, and because real strings are stiff, the higher ones sit slightly sharp of exact multiples. This synth adds several of these partials with that slight stretch, two slightly detuned strings per note (as most piano notes have two or three), a short hammer click, a fast attack and a two-stage decay (a quick drop, then a long fade that lasts longer in the bass than in the treble). A gentle filter makes harder strikes brighter, and a compressor and limiter on the output keep big chords from distorting.

It is a good practice and teaching tool, not a replacement for a real or digital piano. A computer keyboard cannot sense how hard you press, so every computer key plays at the same loudness, and there is no string resonance, half pedalling or weighted action. Bluetooth headphones and speakers delay the sound noticeably, which feels like lag; wired headphones or your device's speaker respond fastest (you can check your speakers with the speaker test). If you play a real guitar alongside, tune it to the piano with the guitar tuner. The guide how to tune a guitar explains how to tune strings to a reference note such as a piano key.

Privacy

Everything runs in your browser: no sound is uploaded and the microphone is never used. Your settings (note names, computer-key labels, volume and sustain) and your last recording (the notes and their timing, not audio) are kept in this browser's local storage, so they are still here next time. Clear removes the recording.

Frequently asked questions

How do I play piano on a computer keyboard?

Use the home row: A plays C, and S, D, F, G, H and J play D, E, F, G, A and B. The keys above them (W, E, T, Y and U) play the black keys, and K, L, semicolon and apostrophe carry on into the next octave. Press Z or X to move down or up an octave and hold Space for sustain.

Where is middle C?

Middle C (C4) is the white key just to the left of the group of two black keys nearest the middle of the keyboard. On this piano it has a small dot, and with the default octave it is the key played by the letter A.

Can I play chords?

Yes. Touch several keys at once on a phone or tablet, or press several computer keys together; up to 32 notes can sound at the same time. Some computer keyboards register only three or four keys at once, so if a chord loses a note, try the touch screen or a different key combination.

Does the online piano work on phones?

Yes. Phones show two octaves at a time with buttons to move up and down, and you can play with several fingers. Turn the phone sideways to see more keys. On an iPhone, if you hear nothing, check the volume and the silent switch, which can mute web audio.

Can I save my recording?

Your last recording is kept in this browser's storage and comes back when you return, unless storage is blocked or you clear it. It stores the notes you played, not an audio file, so it plays back with this piano's sound.

Is this virtual piano free?

Yes: free, with no sign-up and nothing to install, on computers, tablets and phones.

Updated

Copied to clipboard