Eighty-eight keys look like a lot. They are really one small pattern, repeated. Learn the pattern and the whole keyboard is yours.
Meet the keyboard
The piano was invented around 1700 by Bartolomeo Cristofori, who worked for the Medici court in Florence. A modern piano has 88 keys, 52 white and 36 black, running from A0 at the bottom to C8 at the top.
Bartolomeo Cristofori, in a portrait of 1726. The painting is now lost; this photograph of it survives. Bartolomeo Cristofori. Unknown painter, 1726. Wikimedia Commons, Public domain.The keyboard of a piano Cristofori made in Florence in 1720, now in the Metropolitan Museum of Art. The groups of two and three black keys were already there. Grand piano by Bartolomeo Cristofori. Bartolomeo Cristofori, 1720, The Metropolitan Museum of Art. Wikimedia Commons, CC0 1.0.All 88 keys, 52 white and 36 black. The octave number goes up by one at every C, so middle C is C4: the fourth C from the left.
The black-key map
The black keys sit in groups of two and three. Use them as landmarks:
C is the white key just left of a group of two black keys.
D sits between the two black keys, and E is just right of them.
F is the white key just left of a group of three black keys.
G and A sit between the three, and B is just right of them.
Between E and F, and between B and C, there is no black key.
The black keys come in twos and threes. C is always just left of a two, F just left of a three.
Octaves and their numbers
From one C to the next is an octave: 12 keys, white and black, each a semitone apart. Each octave gets a number that changes at C, so the notes from C4 up to B4 all belong to octave 4. Middle C is C4, the fourth C from the left.
One octave, every key named. Each black key has two names: C♯ is the same key as D♭.
The same map on the page
In keyboard staff, the notation on this site, every line is a black key. The bold red line is C♯4, the black key just above middle C, and a dotted grey line marks each place where two white keys sit side by side with no black key between them (E and F, B and C). A white-key note is an oval in a gap or beside a dotted line, so the page looks like the keyboard turned on its side. Both hands share the one staff: notes with stems up are for the right hand, stems down for the left.
Keyboard staff is the keyboard turned on its side. Each line is a black key; the red one is C♯4, just above middle C.
So the groups of two and three black keys you just learnt appear on the page as groups of two and three lines. The How to read page shows one octave with every note labelled.
A two-minute game
Play every C on the piano, from the bottom to the top. There are eight.
Now every F. Then every G.
Close your eyes, put a finger on a group of three black keys, and name the white key just left of it.