A key signature is the set of sharps or flats written next to the clef at the start of every staff (UK: stave). Once you know the order in which those accidentals are added, you can name the key of any piece in seconds. It also works the other way around: given the name of a key, you can tell exactly which accidentals its key signature contains. This page builds on the order of sharps and flats in key signatures.
A key is the home-base note (the tonic) together with the scale built on it. The key signature tells you which notes of that scale are sharp or flat, so you do not have to write the accidental every time. In this page, notes are named with letters (C D E F G A B). In Spanish-, French- and Italian-speaking countries the fixed-do names are used instead: C = Do, D = Re, E = Mi, F = Fa, G = Sol, A = La, B = Si.
Complete chart of keys and key signatures
The chart below shows all 15 key signatures with their major and minor keys. Each major/minor pair shares exactly the same key signature: they are called relative keys.
| Accidentals | Key signature (in order) | Major key | Minor key |
|---|---|---|---|
| 7 ♯ | F♯ C♯ G♯ D♯ A♯ E♯ B♯ | C♯ major → | A♯ minor → |
| 6 ♯ | F♯ C♯ G♯ D♯ A♯ E♯ | F♯ major → | D♯ minor → |
| 5 ♯ | F♯ C♯ G♯ D♯ A♯ | B major → | G♯ minor → |
| 4 ♯ | F♯ C♯ G♯ D♯ | E major → | C♯ minor → |
| 3 ♯ | F♯ C♯ G♯ | A major → | F♯ minor → |
| 2 ♯ | F♯ C♯ | D major → | B minor → |
| 1 ♯ | F♯ | G major → | E minor → |
| 0 | — | C major → | A minor → |
| 1 ♭ | B♭ | F major → | D minor → |
| 2 ♭ | B♭ E♭ | B♭ major → | G minor → |
| 3 ♭ | B♭ E♭ A♭ | E♭ major → | C minor → |
| 4 ♭ | B♭ E♭ A♭ D♭ | A♭ major → | F minor → |
| 5 ♭ | B♭ E♭ A♭ D♭ G♭ | D♭ major → | B♭ minor → |
| 6 ♭ | B♭ E♭ A♭ D♭ G♭ C♭ | G♭ major → | E♭ minor → |
| 7 ♭ | B♭ E♭ A♭ D♭ G♭ C♭ F♭ | C♭ major → | A♭ minor → |
F♯ major and G♭ major are enharmonic: they sound the same on the piano but are written differently. The same is true of C♯ major and D♭ major, and of B major and C♭ major.
The order of sharps (F♯ C♯ G♯ D♯ A♯ E♯ B♯) and the order of flats (B♭ E♭ A♭ D♭ G♭ C♭ F♭) are the same in every key and every clef position. A common memory aid for the sharps is "Father Charles Goes Down And Ends Battle", and for the flats you simply read the sharps backward: "Battle Ends And Down Goes Charles's Father".
Rules for major keys
Key signatures with sharps
The major keys with sharps are, from fewest to most: G, D, A, E, B, F♯ and C♯. The only major key without sharps that is not C is F major, which has 1 flat.
From the key signature to the key: the last sharp of the key signature, raised a half step (UK: semitone), is the tonic of the major key.
- Key signature of 2 sharps (F♯, C♯): last sharp = C♯, a half step higher → D major.
- Key signature of 3 sharps (F♯, C♯, G♯): last sharp = G♯, a half step higher → A major.
- Key signature of 5 sharps (F♯, C♯, G♯, D♯, A♯): last sharp = A♯, a half step higher → B major.
From the name of the key to the key signature: the tonic lowered a half step is the last sharp of the key signature. Write all the sharps in order up to that one.
- A major: tonic A, a half step lower → G♯ (the last sharp). Key signature: F♯, C♯, G♯ (3 sharps).
- E major: tonic E, a half step lower → D♯. Key signature: F♯, C♯, G♯, D♯ (4 sharps).
Key signatures with flats
The major keys with flats are: F, B♭, E♭, A♭, D♭, G♭ and C♭.
From the key signature to the key: the next-to-last flat of the key signature is the tonic of the major key. Exception: with only 1 flat (B♭) the key is F major, because there is no next-to-last flat.
- Key signature of 3 flats (B♭, E♭, A♭): next-to-last flat = E♭ → E♭ major.
- Key signature of 4 flats (B♭, E♭, A♭, D♭): next-to-last flat = A♭ → A♭ major.
- Key signature of 1 flat (B♭): exception → F major.
From the name of the key to the key signature: write the flats in order up to the flat that has the name of the key, then add one more at the end.
- B♭ major: the name contains B♭ → B♭, plus one more → B♭, E♭ (2 flats).
- E♭ major: B♭, E♭, plus A♭ → 3 flats.
Rules for minor keys
A minor key shares its key signature with its relative major. You find the relative major of any minor key by going up a minor third (3 half steps) from the tonic.
From the name of a minor key
The tonic raised a minor third (3 half steps) is the tonic of the relative major. From there, apply the rules above for that major key.
- B minor: a minor 3rd above B is D. The relative major is D major (2 sharps: F♯, C♯).
- G minor: a minor 3rd above G is B♭. The relative major is B♭ major (2 flats: B♭, E♭).
From a key signature to the minor key
First identify the major key of that key signature using the rules above. Then go down a minor third (3 half steps) from its tonic: the result is the tonic of the relative minor.
- Key signature of 3 sharps: the major key is A major. A minor 3rd below A is F♯, so the minor key is F♯ minor.
- Key signature of 2 flats: the major key is B♭ major. A minor 3rd below B♭ is G, so the minor key is G minor.
Shortcut for sharp keys: the tonic of the relative minor is a whole step (UK: tone) below the last sharp. With 3 sharps, the last sharp is G♯ and a whole step lower is F♯, so the minor key is F♯ minor.
Major or minor? Two keys, one key signature
Every key signature belongs to two keys, so the signature alone does not settle which one a piece is in. Check the music itself: look at the first and last notes and chords, and watch for the leading tone. In a minor key the seventh degree is usually raised with an accidental (for example G♯ in A minor), which a major key with the same signature would never need.
The relationship between keys based on their key signatures is covered in closely related keys: two keys whose signatures differ by only one accidental are the closest to each other harmonically.
The key signature of each key, in detail
Choose a key and its key signature is drawn right below, with its accidentals, its relative minor and the rule for recognizing it.
C major key signature
C major has no accidentals: every note is natural. It is the reference key, and it shares its key signature with its relative minor, A minor.
It is the only key with no sharps or flats, and it is the starting point for counting the accidentals of every other key.
G major key signature
G major has 1 sharp: F♯. It shares its key signature with its relative minor, E minor.
The tonic, G, is a half step above the only sharp (F♯).
D major key signature
D major has 2 sharps: F♯ and C♯. It shares its key signature with its relative minor, B minor.
The tonic, D, is a half step above the last sharp (C♯).
A major key signature
A major has 3 sharps: F♯, C♯ and G♯. It shares its key signature with its relative minor, F♯ minor.
The tonic, A, is a half step above the last sharp (G♯).
E major key signature
E major has 4 sharps: F♯, C♯, G♯ and D♯. It shares its key signature with its relative minor, C♯ minor.
The tonic, E, is a half step above the last sharp (D♯).
B major key signature
B major has 5 sharps: F♯, C♯, G♯, D♯ and A♯. It shares its key signature with its relative minor, G♯ minor.
The tonic, B, is a half step above the last sharp (A♯). B major is enharmonic with C♭ major.
F♯ major key signature
F♯ major has 6 sharps: F♯, C♯, G♯, D♯, A♯ and E♯. It shares its key signature with its relative minor, D♯ minor.
The tonic, F♯, is a half step above the last sharp (E♯, which sounds like F natural). F♯ major is enharmonic with G♭ major.
C♯ major key signature
C♯ major has 7 sharps: F♯, C♯, G♯, D♯, A♯, E♯ and B♯. Every note is sharped. It shares its key signature with its relative minor, A♯ minor.
The tonic, C♯, is a half step above the last sharp (B♯, which sounds like C natural). C♯ major is enharmonic with D♭ major, but it is much less used in practice because D♭ major has fewer accidentals.
F major key signature
F major has 1 flat: B♭. It shares its key signature with its relative minor, D minor.
This is the exception to the next-to-last-flat rule: with a single flat there is no next-to-last, so the key is always F major.
B♭ major key signature
B♭ major has 2 flats: B♭ and E♭. It shares its key signature with its relative minor, G minor.
The tonic is the next-to-last flat of the key signature: B♭.
E♭ major key signature
E♭ major has 3 flats: B♭, E♭ and A♭. It shares its key signature with its relative minor, C minor.
The tonic is the next-to-last flat of the key signature: E♭.
A♭ major key signature
A♭ major has 4 flats: B♭, E♭, A♭ and D♭. It shares its key signature with its relative minor, F minor.
The tonic is the next-to-last flat of the key signature: A♭.
D♭ major key signature
D♭ major has 5 flats: B♭, E♭, A♭, D♭ and G♭. It shares its key signature with its relative minor, B♭ minor.
The tonic is the next-to-last flat of the key signature: D♭. D♭ major is enharmonic with C♯ major, but it is used far more often because it has fewer accidentals.
G♭ major key signature
G♭ major has 6 flats: B♭, E♭, A♭, D♭, G♭ and C♭. It shares its key signature with its relative minor, E♭ minor.
The tonic is the next-to-last flat of the key signature: G♭. G♭ major is enharmonic with F♯ major.
C♭ major key signature
C♭ major has 7 flats: B♭, E♭, A♭, D♭, G♭, C♭ and F♭. Every note is flatted. It shares its key signature with its relative minor, A♭ minor.
The tonic is the next-to-last flat of the key signature: C♭. C♭ major is enharmonic with B major, but it is much less used in practice because B major has fewer accidentals.