How to play the virtual piano
- Click or tap a key, or use your keyboard: A S D F G H J K L play white keys from C, and W E T Y U O P the black keys.
- Press Z or X, or use the octave buttons, to move the keyboard down or up.
- Pick a sound such as Soft piano or Organ, and adjust attack, decay, sustain and release.
- Hold Space or tick Sustain to let notes ring like a sustain pedal.
- Click Record, play your part, click Stop recording, then Play back to hear it.
What you can do with Virtual Piano
- Computer keyboard play
- Eighteen keys on two rows map to a piano layout, so you can play melodies and chords without a MIDI keyboard.
- Multi-touch and mouse
- Play several notes at once on a phone or tablet, or glide across the keys by dragging with a mouse or finger.
- Six sounds
- Choose soft piano or organ, or a raw sine, triangle, square or sawtooth synth tone.
- ADSR envelope
- Shape each note with attack, decay, sustain and release sliders, from short plucks to slow, swelling pads.
- Six octave positions
- Shift the 25-key keyboard from C1–C3 up to C6–C8 to reach low bass lines or high melodies.
- Record and play back
- Capture what you play with its timing and replay it in the browser to check a melody or practice a part.
Virtual piano keyboard layout and how the sounds work
The layout follows the usual computer-piano convention: the middle letter row (A S D F G H J K L ; ') holds the white keys, and the row above (W E T Y U O P) holds the black keys, matching their positions on a real piano. Each key's letter is printed on it. The default range starts at C3, so the K key plays middle C (C4). Because the piano is polyphonic, you can hold several keys at once, for example A, D and G together for a C major chord.
The sounds are synthesized live with the Web Audio API rather than played from recorded samples, so the piano tone is a soft, simplified piano rather than a concert grand, and it loads instantly with no large downloads. The ADSR controls work as on a synthesizer: attack is how fast a note starts, decay how quickly it falls to the sustain level, and release how long it rings after you let go. Recordings stay in the page for playback only and aren't saved as audio files.
Frequently asked questions
How do I play the virtual piano with my keyboard?
Use the middle row of letters for white keys, starting with A for C, and the row above for black keys: W is C sharp, E is D sharp, and so on. Z and X shift down or up an octave, and holding Space sustains the notes you play.
Can I play the online piano on a phone or tablet?
Yes. The keys respond to touch, including several fingers at once for chords. On a phone, rotate to landscape for wider keys. If you hear no sound on an iPhone, check that silent mode is turned off.
Does it work with a MIDI keyboard?
No, MIDI input isn't supported. You can play with your computer keyboard, mouse or touchscreen. The computer keyboard covers a little over an octave at a time, from C up to the F above the next C, and Z and X move that range.
Can I save what I play?
You can record a performance and play it back in the page with the note timing preserved. The recording isn't exported as an audio file and is cleared when you leave the page. On a desktop, the Screen Recorder can capture tab audio if you need a file.
Does the virtual piano need a download or plug-in?
No. It runs in any modern browser using the Web Audio API, with no app, plug-in or account. Sounds are generated live, so it starts instantly and keeps working offline once the page has loaded.