Online Piano
Play a free virtual piano: up to 88 keys by mouse, touch, your computer keyboard or a MIDI keyboard, with chords named and your playing recorded.
Press a key, click or tap the keys, or connect a MIDI keyboard.
Z to / play C3 to E4, Q to ] play C4 to G5, with the black keys on the rows above; ← and → move them an octave; Space holds the sustain pedal.
Record what you play
The recording keeps each key and the sustain pedal, so it plays back as you played it. The MIDI file opens in any music program; the WAV is rendered in this tab from the same sounds.
Learn a song
French folk tune, 1761
t t o o p p o i i u u y y t o o i i u u y o o i i u u y t t o o p p o i i u u y y t
Follow the lights: the next key glows blue, and the song waits for you to play it.
Play a letter sheet
Nothing pasted yet.
Keys, touch and sound
A USB or Bluetooth MIDI keyboard plays these sounds, with its velocity and pedals.
How this piano makes its sound
No recordings of a piano are downloaded: every key is made in your browser from the physics of its strings. A struck string sounds many partials at once, and a piano's stiff steel strings stretch them sharp, each a little more than the last; this piano renders up to 64 partials for each key, stretched as a real string's are, with its fundamental kept exactly in tune, so A4 is 440 Hz and every key is in equal temperament. Each partial falls quickly and then slowly, as a piano note does, the higher ones sooner, and a second string a little out of tune makes them beat. The hammer strikes a seventh to a ninth of the way along, which silences the partials at that point, and the soundboard gives little of the lowest notes' fundamentals, so a bass note sounds through its overtones as it does on a piano.
A key is rendered the first time it is needed, and the keys you can see are rendered ahead while the page is idle. On the grand and the electric piano, how hard you play sets the loudness, across a range of 30 dB, and the brightness. The keys above E6 have no dampers, as on a grand, so they ring on when you let go; the sustain pedal holds every key. Nothing you play is sent anywhere: recordings stay in this tab until you download them, and your settings are kept in this browser.
What this tool is used for
- Playing a note or a chord to check a melody, a harmony or a singer's starting pitch.
- Practising a song from a letter sheet one lit key at a time, before playing it on a real piano.
- Plugging in a MIDI keyboard to play with velocity and a sustain pedal when no piano program is installed.
- Naming a chord by finding its notes on the keys: the line under the keyboard names it.
- Recording a short idea and keeping it as a MIDI file for a music program, or as a WAV to send.
- Teaching children the keys with note names or Do Re Mi on them, and a song that waits for them.
How it works in practice
A worked example
A student pastes the first line of a letter sheet of Twinkle, Twinkle, Little Star, with the chord it ends on, and checks what is played.
Letter sheet: t t o o p p o [tuo] Computer keyboard: Letter sheets Transpose: none
8 steps: C4 C4 G4 G4 A4 A4 G4, then C4 E4 G4 together C4 = 261.63 Hz, G4 = 392.00 Hz, A4 = 440.00 Hz Chord: C: C major With E3 below it: C/E: C major, over E
In the letter layout the 36 white keys from C2 to C7 run along 1 to 0, Q to P, A to L and Z to M, so t, the 15th, is middle C, o is G4 and p is A4; brackets play their notes together. Each key's frequency is 440 × 2^((n − 69) / 12) for MIDI note n, so G4, note 67, is 440 × 2^(−2/12) = 392.00 Hz. C, E and G are a root, a major third and a perfect fifth: C major. With E lowest the chord is written C/E.
The edge case that catches people
A capital is the black key above its small letter, so T is C♯4, not C4: a sheet typed with Caps Lock on reads as black keys. Characters that are no key, such as # and &, which would be the black keys above E2 and B2, are listed and left out.
When not to use this tool
It is a piano to play and practise on, not a studio: it records what you play as MIDI or WAV, but has no tracks to edit. It is made from the physics of strings, not sampled from a concert grand. For a steady beat while you practise, keep the metronome open beside it.
Frequently Asked Questions
- How do I play the piano with my computer keyboard?
- With Two rows chosen, Z to / play the white keys from C3 and the row above them the black keys, and Q to ] go on an octave higher, so two and a half octaves are under your hands; ← and → move them an octave. Hold Space for the sustain pedal. Letter sheets puts 61 keys on the keyboard instead.
- Can I use a MIDI keyboard?
- Yes. Plug in a USB or Bluetooth MIDI keyboard and press Connect a MIDI keyboard, then allow MIDI when the browser asks. It plays with the keyboard's velocity, its sustain pedal and its soft pedal. Chrome, Edge, Firefox and Opera can read a MIDI keyboard; Safari cannot.
- How many keys does it have?
- All 88 of a piano, A0 to C8. You can show 2, 3 or 4 octaves, 61 keys, 76 keys or all 88, and move the smaller views up and down by octaves with the arrows beside them. It starts with as many as fit, up to 61: 2 octaves on a phone held upright, with wider keys when it is turned sideways.
- Does it sound like a real piano?
- Made, not recorded: each key is built from the physics of a string, up to 64 partials stretched sharp as a stiff string's are, falling fast, then slowly, with a second string beating against the first. The keys above E6 ring on when let go, as a grand's do. It also has an electric piano, a harpsichord and an organ.
- What are letter sheets, and can I play them here?
- Sheets that write a melody as the keys of a computer keyboard: the 36 white keys from C2 to C7 run along 1 to 0, Q to P, A to L and Z to M, so t is middle C, a capital is the black key above, and [tu] means play together. Choose Letter sheets to play them, or paste one and follow it key by key.
- How do I learn a song?
- Pick one of the nine songs, all old enough to be free of copyright, and press Follow the lights: the next key glows blue and the song waits until you play it, counting any wrong notes. Listen plays the song to you first, with each key lit as it sounds.
- Can I record and download what I play?
- Yes. Press Record, play, then Stop: the recording keeps every key and the sustain pedal. Download it as a MIDI file, at 120 BPM with 480 ticks a quarter note, which any music program opens, or as a WAV rendered in the tab from the same sounds, or copy it as a letter sheet. Nothing is uploaded.
- Is it in tune?
- Yes, in equal temperament from A4 = 440 Hz. Each key's fundamental is placed exactly, and in our measurement every rendered key of the three piano sounds came within a hundredth of a cent of its pitch. Transpose moves every key up or down by up to 12 semitones, to play in another key with the same fingers.
Common errors and gotchas
- Typing into a box and expecting notes: keys typed into a text field are the field's own. Click the keys, or anywhere outside the field, first.
- Notes that keep ringing: Space is the sustain pedal, as on a piano, and the Sustain button holds it down. Let go of Space or turn Sustain off.
- Playing a letter sheet with the two rows: sheets are written for the letter layout, where t is middle C. Choose Letter sheets under Computer keyboard.
- No sound from a MIDI keyboard yet: a browser starts sound only after a click or a key on the page. Connect a MIDI keyboard is that click.
- Leaving Transpose on: every key then sounds a different note from the one it shows, and the line under the keys names the notes heard.