Virtual Xylophone

Tap colored bars to play a bright, bell-like scale.

runs in-browser

Tap or click a bar to strike it. Sound turns on with your first tap, click or key press.

Keys: Z to M play C5 to B5, A to J play C6 to B6 and Q plays the top C7. Drag across the bars for a glissando.

How to play

  • Tap or click a bar to strike it. Each bar rings briefly and fades, like a real wooden bar.
  • Shorter bars on the right sound higher and longer bars on the left sound lower. The range is C5 to C7.
  • Hold the mouse button and drag across the bars for a glissando, or tap several bars with different fingers.
  • Use Z to M, A to J and Q on your computer keyboard, or press Tab and then Enter or Space on a focused bar.

What this virtual xylophone is

This page shows a colorful xylophone with fifteen bars that you strike by tapping, clicking or pressing a key. The bars are arranged from long on the left to short on the right, and they play the C major scale over two octaves, from C5 to C7. Each tap gives a short, bright note that rings and then fades. There is nothing to install and no account to create.

The sound is synthesized in your browser, so no audio files are downloaded. It gives an impression of a struck wooden bar, but it is a simplified imitation and not a recording of a real xylophone. The board is wider than a phone screen, so on small devices it scrolls sideways.

How a xylophone makes its sound

The name comes from two Greek words, xylon for wood and phone for sound. A xylophone is a set of wooden bars, each cut to a length that gives one pitch. When a mallet hits a bar, the bar vibrates for a short time and rings out. A longer bar vibrates more slowly and sounds lower, and a shorter bar vibrates faster and sounds higher. That is why the bars on this page get shorter from left to right.

Makers tune each bar by shaping it, for example by removing a little wood from its underside. The sound is crisp, with a quick click at the start from the mallet and a ring that dies away fast, especially in the higher bars. On this page, each note is built from a pure tone plus two quieter overtones that fade much sooner, together with a very short click for the mallet. It is a rough model and does not match any particular instrument.

The note layout

The fifteen bars play the natural notes of the C major scale, with no sharps or flats. From left to right they are C5, D5, E5, F5, G5, A5, B5, C6, D6, E6, F6, G6, A6, B6 and C7. This is how many children's xylophones are laid out, because the notes always fit together and it is hard to play a bad note.

Each bar is a different color, running from red through yellow and green to blue and purple, which makes it easy to find a bar again and to follow a tune by color. The note name and its computer key are printed on every bar. Western music uses a reference pitch of A4 at 440 Hz, and each bar here follows that standard tuning.

Playing with a mouse, touch screen or keyboard

  • Mouse. Click a bar to strike it. Hold the button and drag across the bars to play a glissando, which is a quick run of notes.
  • Touch screen. Tap a bar. Use two or more fingers to strike several bars together. Swipe sideways to see bars that are off screen.
  • Computer keyboard. The bottom row, Z X C V B N M, plays C5 to B5. The home row, A S D F G H J, plays C6 to B6, and Q plays the top C7.
  • Keyboard navigation. Press Tab to reach the bars and press Enter or Space to strike the bar in focus.

Each strike is a separate sound, so you can play as fast as you can tap, and notes may overlap and ring together.

The xylophone and its relatives

Several instruments share the bar-and-mallet design. The glockenspiel uses metal bars, sounds higher and sparkles more. The marimba has wooden bars like the xylophone but plays lower and has tubes under each bar that make the sound warmer and longer. The vibraphone has metal bars with spinning discs in the tubes that give it a wavering shimmer. Together they are called mallet percussion, or tuned percussion.

Simple xylophones are also common in schools. The German composer Carl Orff helped develop a teaching approach built around xylophones, glockenspiels and drums, since children can make a good sound on them straight away and learn rhythm and melody by playing.

Beginner exercises

  1. The C major scale. Strike the bars from left to right and listen to the pitch rise one step at a time.
  2. Glissando. Hold the mouse button on the first bar and drag slowly, then quickly, to the last.
  3. Twinkle, Twinkle, Little Star. Play the keys Z Z B B N N B, then V V C C X X Z.
  4. Mary Had a Little Lamb. Play C X Z X C C C, then X X X, then C B B.
  5. Octaves. Strike C5, then C6, then C7 (Z, A, Q) and listen to how each one is twice the frequency of the last.
  6. Rhythm. Play one note in a steady pulse, then add a second, quicker pattern with a different note.

What a virtual xylophone is good for

A virtual xylophone is a quick, friendly way to explore pitch, scales and simple tunes. Children can learn that shorter bars sound higher, parents and teachers can use it to demonstrate a melody, and songwriters can use it to try a bright, bell-like line. Try the virtual kalimba for a softer, plucked sound, or the virtual drum kit to add a beat underneath your melody.

Online xylophone versus a real one

With a real xylophone, the player holds a mallet in each hand, chooses between hard and soft heads, and controls the loudness and the tone with the strength and the spot of every hit. The bars have a physical feel and the sound fills a room.

The virtual one lets you try the layout and play a tune on any device. Every strike is the same strength, and you tap rather than swing a mallet, so it cannot teach technique. Treat it as a first try and a way to explore melodies, not as a replacement for a real set of bars.

Limitations of this version

  • The sound is a basic synthesized imitation of a struck bar, not a recording, and does not match any particular xylophone.
  • Every strike has the same strength. Mallet hardness and the strike position cannot be changed.
  • Only the notes of C major are offered, so there are no sharps or flats.
  • The range is two octaves, from C5 to C7.
  • Nothing is recorded or saved, and there is no MIDI input.

Common problems and how to fix them

  • No sound. Browsers keep audio off until you interact with the page, so tap a bar first. Then check the volume slider, your device volume and the tab's mute icon. On an iPhone, also check that the silent switch is off.
  • Some bars are off screen. On a narrow screen the xylophone scrolls sideways. Swipe along it, or turn your phone to landscape.
  • The keys do nothing. Click an empty part of the page so focus is not in another field.
  • The letters play the wrong bars. The layout follows the physical position of keys, so on a non-US keyboard the letters on your keys may differ from the labels on screen.
  • The sound lags. Close heavy tabs and use wired headphones or the device speaker.

Frequently asked questions

Is the virtual xylophone free?

Yes. You can play it with no account, no download and no payment.

What notes does it play?

Fifteen notes of the C major scale, from C5 to C7. There are no sharps or flats, so the notes always sound good together.

Why are the bars different lengths?

On a real xylophone, longer bars vibrate more slowly and sound lower, and shorter bars sound higher. The bars on this page get shorter from left to right to match.

Can I play it on a phone?

Yes. Tap the bars, and use several fingers to play more than one at once. The board scrolls sideways on narrow screens, and landscape shows more bars.

Can I play with my computer keyboard?

Yes. Z to M play C5 to B5, A to J play C6 to B6 and Q plays the top C7. Each bar shows its key.

What is a glissando?

A quick slide through a run of notes. Hold the mouse button and drag across the bars to play one.

How accurate is the sound?

The pitches follow standard tuning, with A4 at 440 Hz. The tone is a basic synthesized imitation of a wooden bar, not a recording of a real xylophone.

Why is there no sound?

Tap a bar first, because browsers block audio until you interact. Then check your volume, the tab mute and, on an iPhone, the silent switch.