Observations about musical keys
2026-11-17 — music
When I had music lessons as a kid I had to learn things "the key of D major has 2 sharps" or "F major has 1 flat" without ever understanding the patterns behind these things. In this post I will answer some of the naive questions of my younger self.
I can't really answer any of the "why" questions, but at least I now understand better how the black and white keys of the piano, sheet music and sharps and flats fit together.
Why sharps and flats
Sharps and flats let us make more names out of the 7 "letter names" used in music (A, B, …, G). There are 12 keys in an octave on the piano so the 7 letters alone are not enough.
The white piano keys have proper names (C, D, E etc.) but the black keys are named by referring to a neighboring white key. "C♯" ("C sharp") is the "black key above C" and "D♭" ("D flat") is the "black key below D". Both names refer to the same key! C♯ and D♭ are enharmonic.
So piano keys can have multiple names. When do you use which name?
In G major, how do I know whether it uses "F♯" or "G♭"?
Going by the intervals between the notes, it's clear that the G major needs to use the black key below the G. But how do we decide whether to call that note G♭ or F♯? It seems that the rule is that notes in a scale must use different letter names. Because "G" is already taken in "G major", we can't use G♭ so we must call that note below the G "F♯".
It's easier to distinguish "F♯" from "G" than "G♭" from "G". Both in writing like here in this blog post, as well as in sheet music: "G" and "G♭" are written on the same line, while "F" is never on the same line as any kind of "G".
Calling the seventh note of G major note "F♯" makes our life easier.
Why does F♯ major have an E♯, isn't that an F?
This idea of simplifying staff notation also explains notes like the E♯ found in the key of F♯ major. The letter "F" is already taken by F♯ so we have to call the note just below it "E♯".
Here we have an example of a white key with more than one name!
How do you know if a key (scale) uses flats or sharps?
You can't mix flats and sharps. F and C are the only white key-keys without sharps. Black keys depend on what you call them.
The reason most white-key keys use sharps is that the seventh note must not have the same letter as the first note. For example, for B major, the seventh note is a semitone below B, and we don't want to call it B♭, so we have to call it A♯. It follows that B major is a key that uses sharps.
Where do the flats or sharps go?
Where the signs land depends on the intervals that define the major scale (2, 2, 1, 2, 2, 2, 1 semitones) and the "rule" of not reusing letters.
Let's look at G♭. Start by laying out the letters. The scale will be wrong at first.
G♭, A, B, C, D, E, F, G♭
Then add flats to make the intervals correct.
G♭, A♭, B♭, C♭, D♭, E♭, F, G♭
A weirder one: let's start from F♭. First write down the letters.
F♭, G, A, B, C, D, E, F♭
Then add the necessary flats:
F♭, G,♭, A♭, B♭♭, C♭, D♭, E♭, F♭
In F♭ major, we need two flats on the B! You would normally call that an A, but we can't call it that now because we already have A♭.
What is the order of the sharps and flats?
In sheet music, the sharps or flats of a key are always written in a specific order. How can I remember this order?
The answer is that the signs form a series and for each key the respective sharps or flats are an initial segment of the series.
The flats are ordered in steps of 5 semitones (a perfect fourth) starting from B♭:
B♭, E♭, A♭, D♭, G♭, C♭, …
For example the key of E♭ is: E♭, F, G, A♭, B♭, C, D, E♭. In sheet music its signs are written in the order B♭, E♭, A♭. To keep them close together vertically, the order is: up a fourth, down a fifth, up a fourth, …
For the sharps, "presentation order" starts from F♯ and moves in steps of 7 semitones (a perfect fifth):
F♯, C♯, G♯, D♯, A♯, E♯, …
If we look at E major then we have: E, F♯, G♯, A, B, C♯, D♯, E. The order the sharps are presented in on a staff is: F♯, C♯, G♯, D♯.
The vertical arrangement is the opposite of the flats: down a fourth, up a fifth, down a fourth, up a fifth, …

Signs of E major. The logical order moves up in fifths: F♯, C♯, G♯, D♯. Visually, we move down a fourth, up a fifth, down a fourth to keep the signs close together.
How will I remember this
From childhood music lessons, I always remembered that the first two sharps are F♯ and C♯, and that the first two flats are B♭ and E♭. It turns out that that is enough to construct the presentation order: the interval from F♯ to C♯ is a fifth so just keep going. The next sharp is G♯. Likewise, from B♭ to E♭ is a fourth and you can keep going with that too: the next one is A♭.
Another way to remember this all is to think of the major keys as being arranged as a series of fifths extending up and down from C. If you move up a fifth from C you get to G. G major adds one sharp relative to C major, namely F♯. If you move another fifth up you get to D major where you add another sharp: C♯. And so it goes on in fifths. In the opposite direction, moving a fifth down from C, you get F major which has one flat at B♭. Moving down another fifth from F you get to B♭ major which adds another flat, at E♭. And so on moving down by fifths.
So if you remember that the first flat is B♭ and you remember that "flats go down" you can keep subtracting fifths and reconstruct the sequence B♭, E♭, A♭, …. And combining the facts that "sharps go up" and that the first sharp is F♯, you know that the sequence continues with C♯, G♯, etc.
Conclusion
I still don't feel like I can really explain why keys and scales work the way they do. But there are "rules" about how the system fits together and I find it easier to remember them now.
More about: music