On the piano, a sharp raises a note by a half step, to the very next key on the right, and a flat lowers it by a half step, to the very next key on the left. The five black keys in each octave sit between white keys, so each is the sharp of its left neighbor and the flat of its right neighbor, and each has two names: C#/Db, D#/Eb, F#/Gb, G#/Ab and A#/Bb. A natural sign cancels a sharp or flat and sends you back to the white key.
The lit keys on the keyboard above are the five black keys of the octave above middle C, labeled with their sharp names. Each could just as well be read by its flat name.
The signs and what they do
Printed music uses five signs, called accidentals, to raise, lower or restore a note. On this site, note names are written with # for sharp and b for flat.
| Sign | Name | What it does on the keyboard |
|---|---|---|
| ♯ | Sharp | Raises a note one half step: the next key to the right |
| ♭ | Flat | Lowers a note one half step: the next key to the left |
| ♮ | Natural | Cancels a sharp or flat: back to the white key of that letter |
| x | Double sharp, drawn like a bold x | Raises a note two half steps: two keys to the right |
| ♭♭ | Double flat | Lowers a note two half steps: two keys to the left |
"The next key" means the next key of either color. Most of the time a sharp or flat lands on a black key, but E and F touch with no black key between them, and so do B and C, so a sharp on E or B, or a flat on F or C, lands on the neighboring white key.
The diagram shows one octave, with both names on every black key. Look for the two places where white keys touch with no black key between them, E and F, and B and C: those are the spots where a sharp or flat moves from one white key to another.
Every black key has two names
Take the black key between C and D. Raise C by a half step and you reach it, so it is C sharp; lower D by a half step and you reach the same key, so it is also D flat. Both names are correct and sound identical on the piano; notes like these, one key with two spellings, are called enharmonic.
Which name appears depends on the key the music is in. A standard key signature uses either sharps or flats, not both, and a major or minor scale is spelled with each letter name once. That is why F major is written F, G, A, Bb, C, D, E: calling its fourth note A# would use the letter A twice and skip B. For the name, color and frequency of all 88 keys, see the piano notes chart.
Sharps and flats on white keys
E and F sit a half step apart with nothing between them, as do B and C, so four sharps and flats land on white keys:
- E# is played on F, and Fb on E.
- B# is played on C, and Cb on B.
These spellings appear wherever a scale needs them. The F# major scale is F#, G#, A#, B, C#, D#, E#, because it needs an E and the E must be raised. The Gb major scale is Gb, Ab, Bb, Cb, Db, Eb, F, and the Ab minor scale contains both Cb and Fb. The C# major chord is spelled C#, E#, G#.
Double sharps and double flats
A double sharp raises a note two half steps and a double flat lowers it two, so each lands on the key a whole step away: F double sharp is G, C double sharp is D, B double flat is A, and E double flat is D. They are uncommon, and they turn up for the same reason as E# and Cb, to keep each letter name in its place. G# major, for example, needs F double sharp as its seventh note, and the C diminished seventh chord is spelled C, Eb, Gb, B double flat.
All the names of each key
Counting double sharps and double flats, every key in the octave has two or three correct names:
| Key | Usual names | Other correct names |
|---|---|---|
| C (white) | C | B#, D double flat |
| Black key between C and D | C#, Db | B double sharp |
| D (white) | D | C double sharp, E double flat |
| Black key between D and E | D#, Eb | F double flat |
| E (white) | E | Fb, D double sharp |
| F (white) | F | E#, G double flat |
| Black key between F and G | F#, Gb | E double sharp |
| G (white) | G | F double sharp, A double flat |
| Black key between G and A | G#, Ab | None |
| A (white) | A | G double sharp, B double flat |
| Black key between A and B | A#, Bb | C double flat |
| B (white) | B | Cb, A double sharp |
G#/Ab is the only key with just two names. The octave number goes with the letter, not the key, so the key C5 can also be written B#4, and the key B4 can be written Cb5.
How long a sharp or flat lasts
A sharp, flat or natural written in front of a note is an accidental, and it lasts for the rest of that bar (measure), for every note on the same line or space of that staff. The next bar line cancels it, except for a note tied across the bar line. In piano music the rule applies to each staff of the grand staff separately. Editors often add a reminder sign in the next bar, sometimes in parentheses, called a courtesy accidental.
A key signature works differently. Its sharps or flats, printed at the start of every staff line, apply to that letter in every octave for the whole piece, until a new key signature appears. Sharps always appear in the order F, C, G, D, A, E, B, and flats in the order B, E, A, D, G, C, F, so one sharp is always F# and one flat is always Bb. The number of sharps or flats tells you the key: a major key, or the minor key that shares its signature. To see which scale goes with each key signature, use the scale finder on our companion site.
Where the signs came from
The flat, sharp and natural signs grew out of the letter b in medieval chant manuscripts, where B was the only note that could be altered. A round b, for the lower B, became the flat sign, and a square b, for the higher B, developed into the sharp and natural signs.
Questions and answers
Is a black key a sharp or a flat?
Both. Each black key is named from either neighbor: raise the white key on its left, or lower the white key on its right, so the key between C and D is C# and Db. The key of the music decides which name you see.
What is E sharp on the piano?
E# is the white key F. There is no black key between E and F, so raising E by a half step lands on F. The same is true of B#, which is played on C.
What does the natural sign mean?
It cancels a sharp or flat, whether from the key signature or from an earlier sign in the same bar, and sends you back to the white key of that letter.
What is a double sharp?
A sign shaped like a bold x that raises a note by two half steps, a whole step. F double sharp is played on G, and C double sharp on D.
How long does a sharp or flat last?
A sharp, flat or natural written before a note lasts until the end of that bar, for notes on the same line or space. The bar line cancels it, except for a note tied across it.
How many names can one piano key have?
Every key has at least two, counting double sharps and double flats. G#/Ab has exactly two, and each of the other eleven keys in an octave has three, such as D, C double sharp and E double flat.