Virtual Piano
A free, browser-based instrument that turns your keyboard into a virtual piano. Play piano online with realistic synthesis, sustain pedal, and instant response.
White Keys (4 rows)
Black Keys (Sharps)
Hold Shift and press a white key
to play its sharp (♯) note.
Press any key to play.
Hold Shift for sharps.
Toggle sustain below.
Everything you need to play piano online
Realistic Synthesis
Web Audio API oscillator synthesis with harmonics and envelope shaping produces warm, piano-like tones with natural attack and decay.
Volume & Sustain
Adjust volume in real time and toggle the sustain pedal to let notes ring out naturally, just like a real piano.
Instant Play
No installation, no loading time. Open the page and start to play piano online immediately with your keyboard or mouse.
How to play piano online with your keyboard
Start Playing
The virtual piano loads instantly — no downloads, no sign-up. Press any key on your keyboard or click the on-screen keys to play your first note.
Learn the Keys
Four rows of your keyboard span 5 octaves. 1–0 plays C2–E3, Q–P plays F3–A4, A–L plays B4–C6, and Z–M plays D6–C7. Hold Shift + any key for sharps.
Customize Sound
Toggle the sustain pedal to let notes ring out after you release the keys. Adjust volume to shape your piano online experience.
Keyboard Mapping
1 2 3 4 5 6 7 8 9 0Q W E R T Y U I O PA S D F G H J K LZ X C V B N MShift + any key aboveMac · Windows · LinuxWhat is a piano? History & how it works
The piano is a keyboard instrument invented by Bartolomeo Cristofori around 1700 in Italy. It produces sound when hammers strike steel strings, giving the player dynamic control over volume through touch — hence its original name, pianoforte (soft-loud).
With 88 keys spanning over 7 octaves, the piano has the widest range of any standard acoustic instrument. It serves as the foundation for music theory education and is central to genres from classical and jazz to pop and film scoring.
Our virtual piano recreates the playing experience using the Web Audio API with oscillator synthesis and envelope shaping. No plugins, no installation — just open your browser and play piano online instantly.
Anatomy of a Piano
Strings
Steel strings of varying length and thickness vibrate when struck by hammers, producing the piano's characteristic tone.
Keyboard
88 keys (52 white, 36 black) spanning 7+ octaves from A0 to C8.
Hammer Action
Felt-covered hammers strike the strings when keys are pressed, then fall back to allow the string to vibrate freely.
Pedals
Three pedals control sustain (right), soft/una corda (left), and sostenuto (middle) for expressive dynamics.
How musicians use this virtual piano
From curious beginners to traveling musicians, our piano onlinetool fits every scenario where a real instrument isn't available.
Beginners
Learn piano basics, practice scales, and build finger coordination without investing in an instrument first.
Songwriters
Sketch out melodies and chord progressions on the go — anywhere you have a browser.
Music Theory
Visualize intervals, chords, and scales on a real keyboard layout. Great for ear training exercises.
Just for Fun
Play your favorite melodies, experiment with sounds, or just unwind with some casual piano playing.
Virtual piano vs. acoustic piano
Acoustic Piano
Virtual Piano
Keys
Octaves
Load Time
Cost
Virtual piano — frequently asked questions
Can I play piano online for free?
Yes. Our virtual piano runs entirely in your browser using the Web Audio API. Open the page and your computer keyboard maps to piano keys instantly. No downloads, no sign-ups — you can play piano online completely free.
Does the virtual piano work on mobile devices?
Yes, the virtual piano works on tablets and smartphones. On touch devices, tap the on-screen keys to play notes. For the best experience with full keyboard mapping to play piano online, we recommend a desktop or laptop.
How realistic is the virtual piano sound?
Our virtual piano uses Web Audio API oscillator synthesis with harmonics and envelope shaping to produce a warm, piano-like tone. While it differs from sampled grand pianos, it provides a pleasant and responsive experience — ideal for anyone looking to play piano online for practice or casual playing.
What keys on my keyboard map to the piano?
The number row (1–0) maps to C2–E3. The letter rows Q–P, A–L, and Z–M continue through F3–A4, B4–C6, and D6–C7 respectively — covering 5 full octaves and 61 keys. Hold Shift + any key to play its sharp (♯) note.
What browsers support the virtual piano?
Our virtual piano works in all modern browsers including Chrome, Firefox, Safari, and Edge. It uses the Web Audio API, which is supported by all major browsers released in the last several years.
Is there a sustain pedal feature?
Yes. The virtual piano includes a sustain toggle that lets notes ring out after you release the keys, simulating a real piano sustain pedal. Toggle it on and off using the control below the keyboard.
About this virtual piano
This free virtual piano is part of the Web Harmonium project. While our main instrument is the harmonium, we built this piano to give musicians another free tool for practice and exploration.
The audio engine uses Web Audio API oscillator synthesis — combining triangle and sine waves with lowpass filtering and ADSR envelope shaping to produce a warm, responsive piano tone. No audio samples to download means instant playback with zero latency.
Inspired by open-source projects like AutoPiano, this virtual piano focuses on simplicity — letting you play piano online with zero friction.
The piano keys are black and white, but they sound like a million colors in your mind.
Ready to play virtual piano?
Scroll back up and start playing piano online. No download, no signup — just your keyboard and instant sound.