Skip to content
Music Theory

Keys and Key Signatures

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.

AccidentalsKey signature (in order)Major keyMinor 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.

Frequently Asked Questions

What is a key signature?
A key signature is the set of sharps or flats placed at the beginning of each staff, next to the clef. It shows which notes are altered throughout the whole piece, and it lets you identify the key without analyzing every note.
How do you find the major key from a key signature with sharps?
Raise the last sharp of the key signature by a half step (a minor second). That note is the tonic of the major key. For example, if the last sharp is G♯, the major key is A major.
How do you find the major key from a key signature with flats?
Take the next-to-last flat of the key signature: that note is the tonic of the major key. For example, with B♭, E♭ and A♭ (3 flats), the next-to-last is E♭, so the key is E♭ major. Exception: with one flat (B♭) the key is F major.
How do you find the minor key from a key signature?
First identify the major key for that key signature, then go down a minor third. The note you reach is the tonic of the relative minor. For example, the relative minor of C major is A minor.
How can you tell whether a piece is in the major or the minor key of a key signature?
Look at where the music starts and ends and which chord feels like home. In the minor key the seventh degree is usually raised by an accidental (G♯ in A minor, for instance), while the major key with the same key signature does not need it.
How many major keys are there?
There are 15 major keys with a key signature: 7 with sharps (G, D, A, E, B, F♯ and C♯ major), 7 with flats (F, B♭, E♭, A♭, D♭, G♭ and C♭ major) and C major with no accidentals. F♯ major and G♭ major are enharmonic, as are C♯ major and D♭ major, and B major and C♭ major.