Why does a piano have white and black keys? The logic behind the keyboard
Published on Thursday 30 July 2026
If you’re looking at a piano keyboard for the first time, the layout might seem random: a few black keys here, a gap there, and the white keys aren’t all evenly spaced in terms of pitch either. Yet there’s a logical explanation behind it — one that dates back to the Middle Ages.
Seven/eight notes as the foundation
The keyboard didn’t start with our twelve different notes, but with eight. Early keyboard instruments, dating back to medieval organs, only played the seven root notes of our Western scales plus the Bb note: A, B, Bb, C, D, E, F and G. Apart from the Bb, these correspond to what we now call the white keys. So you couldn’t simply play in all sorts of keys the way we do now.
Think of a basic recipe with seven ingredients: everything works and tastes good as long as you follow that exact recipe. It’s only when you want to vary things that you notice you’re missing ingredients. That’s exactly the problem people ran into in the 14th century. Musicians wanted to transpose, to play the same melody in a different key, and that required extra notes.
Those extra notes were added as raised or lowered variants of the seven basic notes: the five black keys we know today. The organ of Halberstadt Cathedral (1361) is the oldest documented instrument with this complete 7+5 layout. Since then, the standard piano octave has had 12 keys: 7 white and 5 black, together covering all the semitones you need in Western music.
» Classical piano for beginners – 6 well-known compositions
Why do E–F and B–C have no black key between them?
Play the white keys from C to the next C and you’re playing a C major scale. That scale doesn’t have equal steps: most steps are a whole tone, but between the 3rd and 4th notes (E and F) and between the 7th and 8th notes (B and C) there’s naturally already a semitone. Those two semitones are already built into the white keys themselves.
A black key between E and F wouldn’t add anything, because there’s already a half step there. The same applies to B and C. This might sound like a small detail, but it directly explains why the black keys are grouped into a block of two and a block of three, rather than being spread evenly across the octave.
» View all keyboard instruments
Why were the colours reversed?
On harpsichords and early organs from the 17th and 18th centuries, the colours were exactly reversed: the seven root notes were dark and the five raised notes were light or white. So Bach played on an instrument with black white keys and white black keys. It wasn’t until the 19th century, when the piano was gaining popularity, that the colours were switched to the layout we know today.
The reason for this was partly practical: ivory was available as a material for the broad root-note keys and ebony for the narrower raised keys. But there was also a visual logic at play: the light, broad keys are easier to see. As a result, the current layout is also simply more pleasant to look at while playing.
The Jankó keyboard: a better system nobody wanted
In 1882, Hungarian pianist and engineer Paul von Jankó devised a keyboard on which every octave, chord and scale has exactly the same fingering, regardless of the key. Learn one chord shape and you can play it in all 12 keys without learning a single extra movement. On a traditional keyboard, you have to learn a new hand position for every key — on the Jankó system, that’s a thing of the past.
An added benefit: an octave on the Jankó keyboard is roughly 14% smaller than on a traditional keyboard. This makes it easier for pianists with smaller hands to play large intervals. Manufacturer Decker Brothers in New York was already producing Jankó pianos in the 1890s, but the company stopped around the turn of the century. The system never caught on.
Why not? Think of the QWERTY keyboard: it’s not the most efficient layout either, but millions of typists have already trained their fingers on it. Switching costs more than it delivers. The same applied to the Jankó keyboard: an enormous repertoire already existed, teachers only knew the traditional keyboard, and methods, sheet music and fingerings were all built around the old system. An instrument that’s better on paper loses out to a system that’s already firmly established everywhere.
So the layout of the keyboard isn’t some historical accident we’re now stuck dragging along. It’s a system that grew organically, is logically connected to the structure of Western music, and is so deeply embedded in education, repertoire and muscle memory that even a demonstrably more convenient alternative doesn’t stand a chance.









No comments yet...