The key describes the note around which a piece of music is built. When a song consists of notes from a particular scale, it is said to be written in the key which has the same notes as that scale. For example, if a song contains mostly notes from the C major scale, it is said to be in the key of C major. If a song contains mostly notes from the F major scale, it is said to be in the key of F major. If a song contains mostly notes from the G major scale, it is said to be in the key of G major.
When playing in any major key other than C, the key will contain at least one sharp or flat, and possibly as many as six. Instead of writing these sharps or flats before each note as they occur, they are usually written at the beginning of the piece just before the time signature. These sharps or flats are referred to as a key signature. The sharps or flats in the key signature are the same as the sharps or flats in the corresponding major scale. The major scales and key signatures for the keys of F and G are shown here. Without sharps and flats, these scales would not contain the correct pattern of tones and semitones and would therefore not have the typical do re mi fa so la ti do sound of a major scale.
The G major scale contains one sharp, F#, therefore the key signature for the key of G major contains one sharp, F#.
The F major scale contains one flat, Bb, therefore the key signature for the key of F major contains one flat, Bb.
Some scales contain sharps while others contain flats because there must be a separate letter name for each note in the scale and each scale must contain every letter name. For example, the G major scale contains F# instead of Gb even though these two notes are identical in sound. If Gb was used, the scale would contain two notes with the letter name G and no note with the letter name F. In the key of F major, the note Bb is chosen instead of A# for the same reason. If A# was used, the scale would contain two notes with the letter name A and no note with the letter name B. The note each major scale starts on will determine how many sharps or flats are found in each key signature because of the necessity for the scale to have the correct pattern of tones and semitones in order to sound right.
The following charts show the key signatures of all major scales that contain sharps or flats. The C major scale is not represented because it contains no sharps or flats. As there are twelve notes used in music, including sharps and flats, there are twelve possible starting notes for major scales. However, you can see from the charts that since F# and Gb are enharmonic notes (i.e., the same notes), the scales F# major and Gb major are actually the same. Note too, that only some of the keys that contain sharps or flats, have sharps or flats in their name.
* An interval is the distance between two notes. Intervals are named according to the number of letters they are apart, plus the notes themselves, e.g., C to G is a fifth. For more on intervals, see Progressive Music Theory.