MIDILACE Runs on your device
METHOD · SIGNATURES

How to read a key signature: count the marks, name two keys.

A key signature is a count of sharps or flats placed after the clef, always in the same order, and every count names two keys — a major and its relative minor. Sharps arrive in the order F C G D A E B; flats arrive in the reverse, B E A D G C F. To name the major key, read the last sharp (it is the leading tone, one semitone below the key) or the second-to-last flat (it is the key itself). The relative minor sits a minor third below the major tonic, which is why one signature serves both. This site's export declares no signature at all — its only meta events are an empty track name and end-of-track — so the signature you see in a notation program is the program's default, not the file's statement.

Convert a clip and see what signature it implies
THE SHARPS

Order is fixed, so the count is the message

Sharps are written in the order F, C, G, D, A, E, B — each one a fifth above the last. That order is not a convention you can vary: a staff with two sharps always has F♯ and C♯, never F♯ and G♯. Because the order is fixed, the count alone tells you everything, and the naming rule follows from it: the last sharp added is the leading tone of the key, so the key is one semitone above it.

Three sharps are F♯, C♯, G♯. The last is G♯; one semitone above G♯ is A, so the key is A major. Its relative minor is F♯ minor, a minor third below A — the same three sharps, a different tonic.

THE FLATS

The same ladder walked backwards

Flats are written in the reverse order, B, E, A, D, G, C, F, each a fifth below the last. The naming rule is different and slightly easier: the second-to-last flat is the key. Three flats are B♭, E♭, A♭; the second-to-last is E♭, so the key is E♭ major, and its relative minor is C minor.

One flat is the exception people memorise separately: a single B♭ means F major, because there is no second-to-last flat to read. The table below includes it.

All fifteen signatures, major key and relative minor
SignatureMajor keyRelative minorWhich notes are altered
0C majorA minornone
1 sharpG majorE minorF♯
2 sharpsD majorB minorF♯ C♯
3 sharpsA majorF♯ minorF♯ C♯ G♯
4 sharpsE majorC♯ minorF♯ C♯ G♯ D♯
5 sharpsB majorG♯ minorF♯ C♯ G♯ D♯ A♯
6 sharpsF♯ majorD♯ minorF♯ C♯ G♯ D♯ A♯ E♯
7 sharpsC♯ majorA♯ minorall seven raised
1 flatF majorD minorB♭
2 flatsB♭ majorG minorB♭ E♭
3 flatsE♭ majorC minorB♭ E♭ A♭
4 flatsA♭ majorF minorB♭ E♭ A♭ D♭
5 flatsD♭ majorB♭ minorB♭ E♭ A♭ D♭ G♭
6 flatsG♭ majorE♭ minorB♭ E♭ A♭ D♭ G♭ C♭
7 flatsC♭ majorA♭ minorall seven lowered
Fifteen key signatures laid out from seven flats to seven sharps, each with its major key and relative minor. The empty signature in the middle names C major or A minor and is highlighted.
Seven flats to seven sharps: each count names a major key and its relative minor.
WHAT AN EXPORT SHOWS

No signature in the file, so the staff shows a default

A Standard MIDI File can carry a key signature as a meta event (0xFF 0x59), with a signed byte for the count and a byte for major or minor. The export of this site's test mix carries none: two empty track names and end-of-track are its only meta events. Open it in a notation program and the program will apply its own default — usually no sharps or flats — and that default is a rendering choice, not something the file asserted.

The measured pitch set in that file is A, C, D and E, all natural. The empty signature is therefore the minimal choice: it needs no accidentals to write those four notes. But "no sharps and no flats" names two keys, C major and A minor, and the signature cannot choose between them — that decision comes from which note sits in the bass. If you want the derivation, it is the pitch-set method for finding a song's key; this page stops at the signature, which is where the naming starts.

What a signature does and does not tell you
QuestionSignature answers itIt does not
Which notes are altered by default?yes — the count and order—
Which major key?yes — last sharp or second-to-last flat—
Which relative minor?yes — a minor third below the major tonic—
Which of the two names is the piece in?—no — the bass and the phrase ending decide
Whether the file states it—no — a file with no 0xFF 0x59 event states nothing
QUICK ANSWERS

Questions about key signatures

How many sharps does A major have?

Three: F♯, C♯ and G♯. The last sharp is G♯, one semitone below A, which is the rule that names the key. A major's relative minor is F♯ minor, which uses the same three.

Why do sharps and flats have a fixed order?

Because each one is a fifth from the previous, and the fifths cycle is fixed. F♯ is a fifth above C♯, G♯ a fifth above F♯, and so on. Writing them in any other order would make the count ambiguous and force you to read each mark instead of counting.

What does it mean when there is no key signature?

It means no sharps and no flats by default, which names C major or A minor. It does not mean the piece is in C — a piece can be in D minor and simply write every B♭ as an accidental, though nobody would notate it that way on purpose.

Can the signature change in the middle of a piece?

Yes. A new signature written mid-line marks a modulation, and the accidentals reset at that point. In a MIDI file that would be a second key-signature meta event later in the track; the export measured here has none, because it has no first one either.

Does the key signature tell me the key of a song?

It narrows it to two names and leaves the choice to the music. That is the honest answer, and it is why the signature is a notation tool rather than an analysis result — the analysis needs the notes, the bass and where the phrases land.