The short answer

The contrasting colors help you find your place on the keyboard. In each octave, seven long white keys play the notes named A through G. Five shorter black keys play the pitches in between, grouped in twos and threes. Find a raised pair. The long key immediately to its left is C. That rule even works on a historical piano with black long keys and white raised ones.123

Find C with one finger

Pick a pair of black keys near the middle of a piano. You’ll see a wider gap on either side of the pair. Rest a finger on the left black key, then slide toward you and a little to the left, onto the long white key beside it. Play it. That’s C.1

Move to the right, past a group of three black keys, until you reach the next pair. Try the same move. You’ve found another C, one octave higher. The trio gives you a landmark, too. The long key just to its left is F. The contrasting colors let you spot both landmarks at a glance. Close your eyes and you can still feel the pairs and trios because those keys are raised.12

Why two, then three?

Starting on C, play the long keys in order. Their names run C, D, E, F, G, A, B, then C again. At the front of the keyboard, those keys look evenly spaced. Listen, though, and you’ll hear that C to D is a bigger jump in pitch than E to F.12

The distance in pitch from one piano key to its nearest neighbor is called a half step. C and D are two half steps apart. The black key between them plays the pitch halfway up. Approach it from C and its name makes sense as C-sharp. Approach it from D and you can call it D-flat. Your finger lands on the same key either way.2

D and E have a pitch between them, too. That gives you two raised keys in a row. E to F is already a half step, so the row breaks there. Then F to G, G to A, and A to B each have a pitch in between. That gives you three raised keys. B to C is already a half step. There’s the next break, and the pattern starts over.2

When C is black

The Metropolitan Museum of Art has a piano that the Stein workshop built in Vienna between 1794 and 1802. Its long keys have black ebony at the front. Its raised keys have white bone tops. Imagine sitting down at that keyboard. Where would your finger go for C?3

Find a pair of raised white keys. Play the long black key immediately to their left. There’s C. The clue your finger followed on the modern piano works here, too. The colors changed places over the course of piano history. Why white eventually became the usual color for the long keys is still an open question, according to Yamaha’s instrument guide.134