Definition
The key signature is the set of sharps or flats written right after the clef. It applies to all octaves and to the whole piece, until it changes. It indicates a pair of relative keys (one major and one minor) that share the same notes.
The order of accidentals
- Sharps: F – C – G – D – A – E – B (F C G D A E B). Each sharp is a fifth above the previous one.
- Flats: B – E – A – D – G – C – F (B E A D G C F). It is the order of the sharps reversed; each flat is a fifth below the previous one.
Accidentals are always added in this order: there is no key signature with only C#.
Finding the key
- Sharps: the last sharp is the leading tone of the major key: go up a semitone. Three sharps (F# C# G#) → G# + a semitone = A major.
- Flats: the second-to-last flat is the major tonic. Three flats (Bb Eb Ab) → Eb major. A single flat = F major (to be memorized).
- Relative minor: go down a minor third from the major tonic (A major → F# minor; Eb major → C minor).
- To tell whether a piece is major or minor, look at the first and last chord, the final note of the melody and the presence of the raised leading tone (in A minor G# appears, which is not in the key signature).
Complete table
| Accidentals | Major | Relative minor |
|---|---|---|
| 0 | C | A |
| 1# | G | E |
| 2# | D | B |
| 3# | A | F# |
| 4# | E | C# |
| 5# | B | G# |
| 6# | F# | D# |
| 7# | C# | A# |
| 1b | F | D |
| 2b | Bb | G |
| 3b | Eb | C |
| 4b | Ab | F |
| 5b | Db | Bb |
| 6b | Gb | Eb |
| 7b | Cb | Ab |
Enharmonic pairs: B = Cb, F# = Gb, C# = Db (and their relative minors).
Position on the staff
In treble clef the sharps are written in a zigzag: F5, C5, G5, D5, A4, E5, B4; the flats: B4, E5, A4, D5, G4, C5, F4. In bass clef the same positions an octave lower. The position is fixed: a badly written key signature (e.g. F# on the first space) is considered a spelling error.
Changing key signature
You change key signature with a double barline; at one time the previous accidentals were cancelled with naturals, today often only the new key signature is written. In modal or atonal pieces many composers (Bartók, Stravinsky) avoid the key signature and write only accidentals; for modes some use the key signature of the parent scale (D Dorian with no accidentals), others that of the tonic (D minor with the B natural as an accidental). In pop and jazz practice the second is more common.
Theoretical keys
G# major would require 8 sharps (F## plus the other six): Ab major is written instead. These keys appear only in passing, in modulations, written with accidentals.
Examples in songs
- “Let It Be” (The Beatles): no accidentals, C major.
- “Someone Like You” (Adele): A major, 3 sharps.
- “Clair de lune” (Debussy): Db major, 5 flats.
- “Purple Rain” (Prince): Bb major, 2 flats.
Exercise for the producer
- Take the key of your latest project (Tunebat or your DAW's key detector estimates it) and write the correct key signature along with the notes of the scale.
- Recite the order of sharps and flats and the circle of fifths from memory for two minutes a day for a week.
- In FL Studio, turn on “Scale highlighting” in the Piano roll (Helpers → Scale) on the key of the piece: it is the visual version of the key signature.
Related topics
Circle of fifths and closely related keys; Accidentals; Enharmony; Major scale and minor scales.