The key signature in music is represented by one or many flats (b) or sharps (#), so-called accidentals (there are no accidentals shown for C major since it has no flats or sharps). When using piano sheets you will get the statement of the actual key at the beginning of a written music piece in which you can see symbols for flats or sharps near the staff, this is the key signature.
Let’s look at some examples:
This signifies the key of G. In the picture above the F position in the sheet is marked with a sharp symbol and this is because the notes in the G major scales are G, A, B, C, D, E, F#, G. But this is only logical if you are familiar with noted reading.
This signifies an F key. The notes in the F major scales are F, G, A, Bb, C, D, E, F. This time we have one note with a flat symbol (b), the B. The flat symbol is therefore placed on the B line in the grand staff.
In both cases the symbols # and b means that you should play on a black key instead of the white. The sharp (#) means the black key is to the right of the white key and the flat (b) means the black key is to the left of the white key. F# is, for example, the black key to the right of F and Bb is the black key to the left of B (see also Scale theory - Fundamentals).
In one case - the key of C (C, D, E, F, G, A, B, C) - there is neither sharps nor flats indicated:
What does "in the key of C mean"? It simply means that the music should be played in the C major scale and the tune, in these cases, often starts and ends on a C note. As said, it is common that the first and last note in a tune is a C note (especially the last). Albeit it is not necessary merely notes from the C major scale in the whole tune. Other notes can be involved as well and sometimes the key changes in a song for a while and when return to the original key.
There are no specific symbols for minor keys, but a key signature must not indicate that the piece should be played in major, it can also be played in minor. This is because the minor scales have a relative major scale. So if there is a song in A minor, for example, it is indicated by a C key signature.
List of all keys with accidentals
A complete list of keys with flats or sharps:
C — nor flats or sharps.
G — one sharp.
D — two sharps.
A — three sharps.
E — four sharps.
B — five sharps.
F# — six sharps.
C# — seven sharps.
F — one flat.
Bb — two flats.
Eb — three flats.
Ab — four flats.
Db — five flats.
Gb — six flats.
G# — because of a double sharp it is normally not used.
D# — because of two double sharps it is normally not used.
A# — because of three double sharps it is normally not used.
See also Famous songs listed by key.