Free tool · runs in your browser

Virtual piano

Play two octaves with mouse, touch or keyboard.

Virtual piano

Play with your mouse, touch, or the computer keyboard: A W S E D F T G Y H U J K O L P ; (two octaves from the start note).

This virtual piano gives you two octaves you can play in the browser with a mouse, a touchscreen or your computer keyboard. Choose a piano, organ or synth sound, turn on sustain when you want notes to ring, and move the starting octave anywhere from C2 to C4 to reach lower or higher pitches. It is built for quick practice, checking a melody, finding a note by ear or showing someone how a chord is built.

How to use it

  1. Pick a sound. Choose piano, organ or synth. Piano decays naturally, organ holds steady while a key is down, and synth gives a brighter electronic tone.
  2. Set the starting octave. Select C2, C3 or C4 as the lowest C on screen. The two octaves shown begin from that note.
  3. Play with the mouse or touch. Click or tap any key. On a touchscreen you can press more than one key at once to play chords.
  4. Play with your computer keyboard. The home row plays white keys and the row above plays black keys, laid out like a real piano:
Computer key A W S E D F T G Y H U J K O L P ;
Note C C♯ D D♯ E F F♯ G G♯ A A♯ B C C♯ D D♯ E

These 17 keys cover a little more than one octave, from the starting C up to the E above the next C. Use the mouse or touch for notes beyond that. 5. Use sustain. With sustain on, notes keep sounding after you release the key, like holding a piano’s damper pedal. Turn it off for short, separated notes.

The mapping assumes a QWERTY layout. On AZERTY or QWERTZ keyboards some of these letters sit in different places, so the physical pattern may not match a piano.

How piano notes and octaves work

Pianos and almost all digital instruments use twelve-tone equal temperament. The octave is split into 12 equal semitones, and each semitone raises the frequency by a factor of the twelfth root of 2, about 1.05946. Twelve of those steps multiply the frequency by exactly 2, which is why a note one octave up sounds like the “same” note, only higher.

The usual reference pitch is A4 = 440 Hz. Every other note follows from it. Using MIDI note numbers (where middle C is 60 and A4 is 69), the frequency of note n is:

f = 440 × 2^((n − 69) / 12)

Note names here use scientific pitch notation, where the octave number goes up at each C and C4 is middle C. That gives these lowest notes for each starting octave:

Starting note MIDI number Frequency
C2 36 65.41 Hz
C3 48 130.81 Hz
C4 (middle C) 60 261.63 Hz

Black keys are the sharps and flats. C♯ and D♭ are the same key on a piano, so the table above uses sharps for simplicity.

What this tool does not do

It does not record, save or export what you play, and it does not connect to MIDI keyboards. Computer keys and mouse clicks can’t sense how hard you press, so every note plays at the same volume. You get two octaves at a time, not the full 88 keys of a piano, and the highest starting point is C4.

FAQ

Why do some chords drop notes when I use my computer keyboard?

Many keyboards can only register a few keys pressed at the same time, a hardware limit called key rollover. Certain combinations get blocked before the browser ever sees them. Playing the chord by touch, or on a keyboard with better rollover, usually fixes it.

Where is middle C?

Middle C is C4. Set the starting octave to C4 and the leftmost key is middle C. With the starting octave at C3, middle C is the second C on screen. Some manufacturers label middle C as C3, so other software may number octaves one lower.

Why is there a slight delay between pressing a key and hearing the note?

Browser audio and your device add a small amount of latency. Bluetooth headphones and speakers add much more, often enough to notice. Wired headphones or built-in speakers give the most immediate response.

Can I learn piano with this?

It is useful for learning note names, intervals, scales and simple melodies, and for ear training. It can’t teach finger technique, hand position or dynamics, because a computer keyboard and mouse feel nothing like weighted piano keys. Treat it as a reference and practice aid alongside a real instrument.