Everyday tool

Virtual Piano

Select a key or tap the piano keys. Sound is generated locally by your browser.

Runs in your browser. No upload.

Values are processed locally in this browser.

About this tool

Virtual Piano made simple.

Audio quality depends on your device and browser. No recording or audio upload is performed.

Guide

Using Virtual Piano

This page shows one small row of piano keys that you can play with a mouse, a finger or your computer keyboard. There are 13 keys, from one C up to the next C, with the five black keys included. Each note is a simple tone made inside your browser, and it lasts for as long as you hold the key. A volume slider sits above the keys. It is a toy for trying out notes, not a full instrument and not a recorder.

How to use it

  1. Click or tap a key to play its note. The key stays pressed and the note keeps sounding until you let go.
  2. Use your computer keyboard if you prefer. The white keys from C to the next C are A, S, D, F, G, H, J and K, and the black keys are W, E, T, Y and U.
  3. Drag the Volume slider to make the sound softer or louder. It starts at 35 out of 100, and a change reaches notes that are already sounding.
  4. Hold more than one key to play a chord. Your keyboard hardware limits how many keys it reports at the same time.

Worked examples

The C key at the left end

You enter
Key
first white key, or A on the computer keyboard
Midi note
60
You get
Frequency
261.63 Hz

The page turns a MIDI note number into a pitch with 440 times 2 to the power of (note minus 69) over 12. Note 60 gives 261.63 Hz. Note 60 is often called middle C.

Run through the tool’s own code.

The A above middle C

You enter
Key
H on the computer keyboard
Midi note
69
You get
Frequency
440 Hz

Note 69 sits at the reference of the formula, so the power is zero and the answer is exactly 440 Hz. The highest key, K, is note 72 and gives 523.25 Hz, one octave above the first key.

Run through the tool’s own code.

A C major chord from the keyboard

You enter
Keys
A, D and G held together
You get
Notes
C, E and G
Frequencies
261.63 Hz, 329.63 Hz and 392.00 Hz

A is note 60, D is 64 and G is 67. The code starts a separate tone for every key held down, so the three notes can sound together. I did not listen to the result in a browser.

Not run through the tool. Treat it as an illustration.

Volume at its default and at its maximum

You enter
Slider
35, then 100
You get
Peak level
about 0.07, then 0.2

The page sets each note's peak loudness to the slider value divided by 100, times 0.2. So 35 gives about 0.07 and 100 gives 0.2. A slider value of 0 is held at a tiny floor of 0.0001, which you will not hear.

Run through the tool’s own code.

When it helps

  • Finding a note by ear when you are away from a real piano or keyboard.
  • Showing children how pitch rises from the left of a keyboard to the right.
  • Checking a melody on the black and white keys while you learn the layout.
  • Playing a reference note before you sing or tune an instrument by ear.
  • Trying a few chords on a laptop without installing any software.

Limits to keep in mind

  • Only 13 keys are available, from MIDI note 60 to 72. There is no way to shift the octave or play lower or higher notes.
  • Every note is a plain tone made by an oscillator, whose default shape is a sine wave. It does not sound like a recorded piano.
  • There is no sustain pedal, no touch sensitivity and no recording. Releasing a key fades the note out quickly.
  • The computer key letters are not shown on the page, which only marks the two C keys. You have to know the mapping to use it.
  • Keys are matched by the character they type, not by their position, so layouts other than a standard QWERTY may feel different.

Tips

  • Click on the page itself, not on the Volume slider, before you use the computer keyboard. A focused slider makes the letter keys do nothing.
  • Start with the volume low and raise it slowly, especially if you use headphones.
  • Sliding from one key to the next does not play the next note, so lift and press again for each note.
  • If a note sticks or stops, press a key once more. The page releases all notes when you switch to another window.

Sources

Common questions

About Virtual Piano.

How many keys does the virtual piano have?

It has 13 keys: eight white and five black, from one C to the next C. That is a single octave plus the top C. The page does not offer other octaves or a full 88-key range.

Which computer keys play which notes?

A is C, W is C sharp, S is D, E is D sharp, D is E, F is F, T is F sharp, G is G, Y is G sharp, H is A, U is A sharp, J is B and K is the upper C. Capital letters also work.

Why do the computer keys stop working?

The page ignores key presses while a text box, a slider or a drop-down has focus. After you use the Volume slider it keeps focus, so click on empty page space first. Keys are also read by character, so other layouts may differ.

Can I play several notes at once?

Yes, with the computer keyboard or a touch screen, because a mouse can hold only one key at a time. The page starts a separate tone for each key held down. Many keyboards can only report a limited number of keys at once.

Does it sound like a real piano?

No. Each note is a simple generated tone with a quick fade at the end, not a sample of a piano. It is good for checking pitch and playing a tune, but the tone is plain compared with a recorded piano.

What is the pitch of the first key?

The first key is MIDI note 60 and sounds at about 261.63 Hz. Notes follow the usual rule that A above middle C, note 69, is 440 Hz, and each step up is one semitone, about six percent higher in frequency.

Why is there no sound at all?

Press a key or click on a note first, because browsers only allow audio after you interact with the page. Then check that your device is not muted and the Volume slider is above zero. The page shows an error if audio cannot start.

Can I record or save what I play?

No. The page offers no recording, saving or export, and the page states that it does no audio recording or upload. If you want to keep a tune, write down the note names as you play.

Will it work on a phone or tablet?

The keys react to pointer touches, so tapping should play notes, and you can hold several fingers down at once. I could not test it on every device, and a small screen makes the keys small, so a larger screen may be easier.

How do I use Online virtual piano?

Select a key or tap the piano keys. Sound is generated locally by your browser.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.