Every major scale defines a key. Key signatures are how we write them down.
Listen to this song. It's in the key of C.
You've probably heard that terminology before — something being "in the key of D" or simply "in G" — but what does that actually mean?
Skip to around 2:00 in the video above, the last few seconds of the performance. When he plays that final chord, it really feels like home base, doesn't it? The song sounds complete and finished.
That last note is a C.
That feeling of "home" is a big part of what it means to be in a key. But there's a more technical side too: music in a specific key uses mostly notes from that key's major scale. In many cases, only notes from that scale. The key of C means the music is built from the C major scale. The key of G means the G major scale. And so on.
That's one of the reasons the major scale is so foundational. It creates a very strong sense of resolution. Grab your instrument or go to our online keyboard and play around with a major scale (any key — don't overthink this). Notice how the notes seem to pull you toward the root (root = "the first note of the scale"), and when you finally land on it, you feel that resolution.
In the last lesson we built a G major scale and saw that it needs an F#. Every time you write music in the key of G, every F is sharped. Writing that sharp next to every single F gets old fast.
A key signature solves this. It's a set of sharps or flats written at the beginning of the staff, right after the clef, that apply to the entire piece. Instead of marking every F# individually, you put one sharp on the F line at the start, and you're done.
Here's a simple melody in B major written without a key signature — every accidental has to be marked:
Now the same melody with a B major key signature:
The first is tedious to write and harder to read — all that visual noise from the accidentals means you have to process every single note individually. The second is much cleaner. If you know you're in B major, the key signature handles everything and you just read the notes.
Since scales (and keys) have predictable patterns of flats and sharps, a key signature can also work as a symbolic shorthand for knowing the key you’re in. so when you see a key signature with three flats at the beginning of a piece of music, that doesn’t ONLY tell you “every time you play a B E or A, play them flat”; it also tells you that you’re in the key of Eb. Eb is your root, your home base.
The order of sharps
Sharps and flats never coexist in a key signature. A key has one or the other (or neither, in the case of C major).
Sharps always appear in the same order. If there's one sharp, it's always F#:
If there are two, they're always F# and C#:
Three sharps? F#, C#, G#. And so on, all the way up to seven:
The full order of sharps is: F C G D A E B
A couple mnemonics if you want one:
- Father Charles Goes Down And Ends Battle
- Fat Cats Go Down Alleys Eating Birds
The order of flats
Flats work the same way, in the reverse order: B E A D G C F
One flat is always Bb:
Two flats are always Bb and Eb:
All seven:
Some mnemonics:
- Battle Ends And Down Goes Charles' Father
- Before Eating Anything, Drink Great Cold Fluids
- Blanket Explodes And Dad Gets Cold Feet
Reading a key signature
So you're looking at a piece of music and you see sharps or flats at the beginning of the staff. How do you figure out what key you're in?
For sharp keys: the last sharp in the key signature is always one half step below the key. If the last sharp is F#, you're in G. If the last sharp is C#, you're in D. Last sharp + one half step up = the key.
For flat keys: the second-to-last flat is the key. If you see Bb and Eb, you're in Bb. If you see Bb, Eb, and Ab, you're in Eb. The one exception is F major — it only has one flat (Bb), so there's no "second-to-last" to look at. You just have to know that one.
No sharps or flats? That's C major.
All 15 major keys
You don't need to memorize this table — it's here for reference. There's a pattern connecting all of these keys, and we'll cover that when we get to the Circle of Fifths.
| Key | Sharps/Flats |
|---|---|
| C | — |
| G | 1 sharp (F#) |
| D | 2 sharps (F# C#) |
| A | 3 sharps (F# C# G#) |
| E | 4 sharps (F# C# G# D#) |
| B | 5 sharps (F# C# G# D# A#) |
| F# / Gb | 6 sharps or 6 flats |
| C# / Cb | 7 sharps or 7 flats |
| F | 1 flat (Bb) |
| Bb | 2 flats (Bb Eb) |
| Eb | 3 flats (Bb Eb Ab) |
| Ab | 4 flats (Bb Eb Ab Db) |
| Db | 5 flats (Bb Eb Ab Db Gb) |
If you're counting, the "15" comes from the fact that F#/Gb and C#/Cb are enharmonic pairs — same pitches, different names. In practice there are 12 unique keys, just like there are 12 unique notes.
Our explanation above was a little more thorough than usual, so the resources on this one are a little lighter... however it's always good to expose yourself to content more than once, and the musical examples in the videos are SUPER useful!
- Piano From Scratch - What does 'in the key of' mean? - In the second half of the video he starts talking about MINOR keys.... that's our next lesson! You can pause there, or keep watching to get a preview of where we're going next!
- Brad Harrison Music - Key Signatures
See if you can identify the major key from the key signature. Remember the rules above!
Want more? The full Key Signature Trainer lets you configure difficulty, add minor keys, and set a timer.