How to Play Piano on Your Computer Keyboard

Key mapping for the online piano, octave shifting, chords with sustain, note name display, recording your playing and connecting a MIDI keyboard.

6 min read · Updated 2026-10-06

The Online Piano is a free browser piano you can play with a mouse, touch, or your computer keyboard. No real keys needed for simple melodies, and with some practice you can keep up with faster tunes too.

1. Learn the layout: two rows, two octaves

The keyboard mapping uses two rows. The bottom row (Z S X D C V G B H N J M) plays the lower octave and the top row (Q 2 W 3 E R 5 T 6 Y 7 U) plays one octave higher. Within each row, white keys and black keys (sharps) alternate.

The bottom row in detail: Z = C, S = C#, X = D, D = D#, C = E, V = F, G = F#, B = G, H = G#, N = A, J = A#, M = B. The white keys run Z X C V B N M, with the sharps S D G H J in between. The top row repeats the same pattern one octave up.

2. Learn it by looking at the screen

Don't try to memorize it all at once. Each on-screen key shows which computer key to press and the note name, so after a few tries your fingers learn the positions. Start with an easy melody like "Twinkle, Twinkle, Little Star".

Advertisement (guide-mid)

3. Shift octaves for a wider range

Two octaves (24 notes) are visible at a time. For lower or higher notes, press Octave ▼ or Octave ▲ to move the keys and the keyboard mapping one octave at a time. If a melody feels too low, press Octave ▲ once and play the same finger pattern.

4. Chords and sustain

Press several keys at once to play a chord (some keyboards limit how many keys register at the same time). Turn on Sustain and notes keep ringing after you let go, like a piano's sustain pedal. For short, crisp notes, turn it off.

5. Note names: C D E or Do Re Mi

The keys show letter names (C D E F G A B) by default. You can switch the labels to solfège (Do Re Mi) if that's what your lesson material uses.

6. Record and play back

Press the record button, play, then stop recording. The notes and their timing are saved, and Play recording replays them. This is a performance record that replays on the page, not an audio file. It's handy for listening back to a passage you just practiced.

7. Using a MIDI keyboard

If you have a USB or Bluetooth MIDI keyboard, playing feels much more natural. Press the MIDI keyboard button and allow the browser permission. This uses the Web MIDI API, which works in recent Chrome and Edge but not in some browsers such as Safari.

Note names and MIDI numbers

Notes follow scientific pitch notation. Middle C is C4, MIDI note 60. The reference A4 is 440 Hz, MIDI note 69. Each step up in MIDI number is one semitone, and 12 steps is exactly one octave.

Common mistakes

If another input box (like a search field) has focus, your key presses type text instead of playing notes. Click or tap the piano area once, then play. Also start at a medium volume: several notes at full volume can sound harsh.

Frequently asked questions

Which computer keys play which notes?

Bottom row: Z = C, S = C#, X = D, D = D#, C = E, V = F, G = F#, B = G, H = G#, N = A, J = A#, M = B. The top row (Q 2 W 3 E R 5 T 6 Y 7 U) plays the same pattern an octave higher.

How do I play higher or lower notes?

Use the Octave ▲ and Octave ▼ buttons to shift the keys and mapping one octave at a time.

Does recording create an audio file?

No. It saves the notes and timing and replays them on the page.

Can I connect a MIDI keyboard?

Yes, in browsers that support the Web MIDI API, such as recent Chrome and Edge. Safari and some other browsers don’t support it.

Why do my keys type text instead of playing?

Another input box has focus. Click or tap the piano area once, then play.

Sources and date checked

Checked: October 4, 2026

This article is general information. Actual behavior can vary slightly by browser and device.

Related roundup: see How to Use Online Practice Tools for the full practice routine.

Related tools

Advertisement (guide-end)