Key signatures, and how to read them
A key signature is the group of sharps or flats written at the start of each line of music. It tells you which notes are raised or lowered throughout the piece, and which key it is in. 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. Tap any signature below to hear its major scale.
What a key signature does
Music in D major uses F♯ and C♯ all the time. Instead of writing a sharp next to every F and C, the composer puts two sharps at the start of each line. From then on every F is played as F♯ and every C as C♯, in every octave, until the signature changes.
A sharp, flat or natural sign written next to a single note (an accidental) overrides the key signature for the rest of that bar only. A natural sign (♮) cancels a sharp or flat, so in D major an F with a ♮ in front of it is a plain F until the next barline.
The order of sharps and flats
Sharps are always added in the same order: F, C, G, D, A, E, B. The usual memory line is "Father Charles Goes Down And Ends Battle". A key with three sharps has the first three: F♯, C♯ and G♯. It never skips one.
Flats run the same letters backwards: B, E, A, D, G, C, F, or "Battle Ends And Down Goes Charles's Father". Each sharp or flat also sits in the same place on the staff every time, so after a while you recognize a signature by its shape.
Naming the key from sharps
Find the last sharp and go up one half step. That note is the major key.
- One sharp: the last is F♯, a half step up is G, so G major.
- Two sharps: the last is C♯, a half step up is D, so D major.
- Three sharps: the last is G♯, a half step up is A, so A major.
- Four sharps: the last is D♯, a half step up is E, so E major.
- Five sharps: the last is A♯, a half step up is B, so B major.
Naming the key from flats
With two or more flats, the second-to-last flat is the major key. The one exception to memorize is one flat (B♭), which is F major.
- Two flats (B♭ E♭): the second-to-last is B♭, so B♭ major.
- Three flats (B♭ E♭ A♭): the second-to-last is E♭, so E♭ major.
- Four flats (B♭ E♭ A♭ D♭): the second-to-last is A♭, so A♭ major.
- Five flats (B♭ E♭ A♭ D♭ G♭): the second-to-last is D♭, so D♭ major.
- Six flats (B♭ E♭ A♭ D♭ G♭ C♭): the second-to-last is G♭, so G♭ major.
Minor keys share the signature
Every signature belongs to two keys: a major key and its relative minor, three half steps lower. Two sharps (F♯, C♯) means D major or B minor; three flats (B♭, E♭, A♭) means E♭ major or C minor. To decide which, look at how the music starts and ends and where the bass settles. Minor-key music also tends to carry one extra accidental, the raised 7th: in A minor, G♯ shows up written in by hand.
All 15 key signatures
The site's key pages use the 12 most common spellings. The three extra signatures, C♯, G♭ and C♭ major, sound the same as D♭, F♯ and B major, so they link to those pages.
| Signature | Major key | Relative minor | |
|---|---|---|---|
| no sharps or flats | C major | A minor | |
| one sharp (F♯) | G major | E minor | |
| two sharps (F♯, C♯) | D major | B minor | |
| three sharps (F♯, C♯, G♯) | A major | F♯ minor | |
| four sharps (F♯, C♯, G♯, D♯) | E major | C♯ minor | |
| five sharps (F♯, C♯, G♯, D♯, A♯) | B major | G♯ minor | |
| six sharps (F♯, C♯, G♯, D♯, A♯, E♯) | F♯ major | D♯ minor (page: E♭ minor) | |
| seven sharps (F♯, C♯, G♯, D♯, A♯, E♯, B♯) | C♯ major (page: D♭ major) | A♯ minor (page: B♭ minor) | |
| one flat (B♭) | F major | D minor | |
| two flats (B♭, E♭) | B♭ major | G minor | |
| three flats (B♭, E♭, A♭) | E♭ major | C minor | |
| four flats (B♭, E♭, A♭, D♭) | A♭ major | F minor | |
| five flats (B♭, E♭, A♭, D♭, G♭) | D♭ major | B♭ minor | |
| six flats (B♭, E♭, A♭, D♭, G♭, C♭) | G♭ major (page: F♯ major) | E♭ minor | |
| seven flats (B♭, E♭, A♭, D♭, G♭, C♭, F♭) | C♭ major (page: B major) | A♭ minor (page: G♯ minor) |
Tips for learning them
- Learn the order of sharps and flats first. Every other rule depends on it.
- Memorize the four keys with the fewest accidentals on each side: G, D, A, E and F, B♭, E♭, A♭.
- Use the circle of fifths: each step clockwise adds a sharp, each step counterclockwise adds a flat.
- Play the scale for each signature. The sound of the scale anchors the signature in memory.
- Practice reading in both clefs: treble clef notes and bass clef notes.
Related: chords in every key · scales · C major scale · how to read music · music theory basics
Key signature questions
What is the order of sharps?
F, C, G, D, A, E, B. A common way to remember it is "Father Charles Goes Down And Ends Battle". A key with three sharps always has the first three: F♯, C♯ and G♯.
What is the order of flats?
B, E, A, D, G, C, F, the order of sharps backwards. Read it as "Battle Ends And Down Goes Charles's Father". The first four spell the word BEAD.
How do you tell the key from a key signature?
With sharps, go up a half step from the last sharp: the last sharp in two sharps is C♯, so the key is D major. With flats, the second-to-last flat is the key: three flats end B♭, E♭, A♭, so the key is E♭ major. One flat is F major. Each signature also fits one minor key, three half steps below the major.
What key has no sharps or flats?
C major and its relative minor, A minor. Both use only the white keys of the piano.
How do I know if a piece is in the major or the minor key?
Check the first and last chords and the bass notes, which usually land on the home note. In minor keys, look for an extra accidental a half step under the home note: pieces in A minor often have G♯ written in, from the harmonic minor scale.
Why are there 15 key signatures but only 12 keys on the piano?
Three pairs of major keys sound the same but are spelled differently: B and C♭ major, F♯ and G♭ major, C♯ and D♭ major. Counting both spellings gives 15 signatures: no accidentals, one to seven sharps, and one to seven flats.
Every signature on this page is computed from its scale by the site's theory engine. Updated September 2026.