What are Key Signatures and How Do You Write Them?

What are Key Signatures?

A key signature is a collection of accidentals written on the stave (staff), usually at the start of the piece of music. An accidental is a symbol that indicates if a note is sharp, flat or natural.

Flat, natural and sharp signs
By having these accidentals at the start of the music the player knows that these notes, in any octave, must be raised or lowered from their natural pitches. The key signature tells us the 'key' or 'scale' that the piece is written in. Let's look at an example.
The key signature is written in-between the clef and the time signature and is always before the first note of the melody. The piece above has an F# and C# in the key signature. This means that whenever you see an F or C in the piece, you must raise these particular notes up a semitone and play a F# or C# instead. This is useful for the composer, as they do not need to write a sharp sign on every F and C in the piece, saving a lot of time!

So as the key signature has these two sharps, this piece is in D Major. D major has two sharps and is the only major scale to have this specific key signature. For more on why this key is called D Major, check out our Major Keys post.

Other accidentals

The piece may have other accidentals written in it to add 'flavour' but these fall outside the main scale and have to be written in each time. For more information on this then make sure to check out the chromatic scale post. 

How do you write a key signature?

To confidently write a key signature, you need to know three things:


  • The key your piece is in.
  • The sharp or flat notes in that key.
  • The order that these should be written in.
There are 13 major key signatures, broken into 6 with sharp key signatures, and 6 with flat key signatures and 1 with no key signature at all. The key of C Major is unique in that it does not contain any sharps or flats. This means that the space for the key signature will appear empty and only a time signature will appear before the first note.

A great way to remember the names and see the relationships between all the key signatures is to understand the circle of fifths. This diagram supports our understanding of key signatures and deserves its own post as it is so important!

circle of fifths, treble clef, key signatures, major scales, minor scales

Once you have a good understanding of the different scales/keys it is then important to look at how to write these sharps and flats into the key signature. 

There is a specific order to how the sharps and flats are written in key signatures.


The order of the sharps is as follows -F# C# G# D# A# E# B#.

It is much easier to remember the order of these sharps with a mnemonic to begin with. You can make your own up, but my favourite is Father Christmas Gets Dad An Electric Blanket.

The order of the flats is - Bb Eb Ab Db Gb Cb Fb.

Again, it is much easier to remember the order of these flats with a mnemonic. You can make up your own but my favourite for this one is: Blanket Explodes And Dad Gets Cold Feet.


Note that a key signature will only be written in all sharps or all flats, there will never be a mixture. 

Below you can see tables of our sharp and flat key signatures. 

Sharp Keys

sharp key signatures, major scales, accidentals

Flat Keys

flat key signatures, accidentals, major scales

How does a minor key signature work?

The key signatures will only tell you the Major key that the piece is in and not their relative minor. By memorising the circle of fifths you can know the relative minor to each major key. This will help to work out if the piece is written in the major scale or the relative minor scale.

Both of the major and its relative minor scales share the same key signature and therefore it is important to look out for extra accidentals (sharps or flats) in the piece, in addition to those in the key signature. If there are any extra accidentals this may mean that the piece is written in a minor key. See our Minor Scales post for more info.

Can you write key signatures in different clefs?

Key signatures can be written in all four of the main clefs. For the treble, bass and alto clef, the order and position of the accidentals on the stave does not change. They follow the pattern of first sharp high on the stave, the second sharp low, third sharp high etc. The flat key signature starts with the first flat low on the stave, then we move up for the next one, back down, etc. The tenor clef is slightly different. The flat keys follow the same pattern but for the sharp keys, the pattern is the opposite to the other clefs. The first sharp starts low on the stave, then we move up for the next one, back down etc. Take a look at the diagram below.

sharp key signatures, all clefs, bass clef, treble clef, alto clef, tenor clef

Can you change the key signature in a piece?

The short answer is, yes you can! Many songs and pieces of music change key signatures part way through and this will be shown with a new key signature written part way through the music.

key change, F major, G major, melody with key change

The piece above begins in the key of G major and then changes to the key of D major. This is called a key change or a modulation.

We usually modulate to a relative key! To find out more check out the post on modulating!


Many pop songs also have key changes and there are a few examples below:

  • Whitney Houston - I Wanna Dance With Somebody (Who Loves Me)
  • Celine Dion - My Heart Will Go On
  • Adele - All I Ask
  • Lady Gaga - Perfect Illusion
Author: Jade Bultitude
Jade is an experienced musician and teacher as well as being the founder of Music Theory Foundations.

She has been helping people learn music theory for more than 10 years from pre school children all the way to degree level studies.

Get Your Free Revision Guide for Grade 5 Music Theory!
Lay your foundations for Grade 5 Music Theory with this summary of each topic.
Get Your Free Revision Guide for Grade 5 Music Theory!
Lay your foundations for Grade 5 Music Theory with this summary of each topic.