A standard piano keyboard contains 88 keys, of which 36 are black and the remaining 52 are white. The black keys, which are narrower and set back further from the front of the keyboard than the white keys, are used to produce sharps and flats of adjacent white keys, thereby greatly expanding the number of notes and scales that a piano can play.
The black keys are arranged with a regular pattern of alternating sets of two and three and with each set separated by two white keys. This pattern, which is dictated by the locations of the sharps and flats, and which is identical for each octave, also serves the very important function of allowing the piano player's eyes and fingers to easily and quickly distinguish among the 52 white keys.