Music Hub › Guides › Getting started › Understanding keys and key signatures
Understanding keys and key signatures
Key signature and key: related, but not the same thing
A key is a set of seven notes built around a tonic, the resting note the music keeps falling back to; the Music Hub guide "Major and minor scales to get off to a good start" explains in detail how that scale is built note by note and why major and minor sound so different from each other. The key signature does not deal with any of that: it is a plain graphic shortcut, the piece of notation that announces once, at the start of every line of the staff, which notes will be played sharp or flat throughout the whole piece. Without that shortcut, the same accidental would have to be repeated in every single bar where the note shows up: a two-hundred-bar song in D major, which only carries two accidentals in its signature, F sharp and C sharp, can bring those two notes back dozens of times over its length, each one a spot where a sharp would need to be redrawn by hand without the signature.
The classic trap is to assume the key signature tells you everything about the key. In reality, a signature with two sharps does not tell you whether a piece is in D major or in B minor: the two keys share the exact same signature, and the sharp count alone gives no way to choose between them. Nor does it guarantee that no other accidental will show up in the score: occasional sharps or flats, called accidentals, can perfectly well appear along the way, for a passing modulation or a particular harmonic colour, without the signature ever changing. What the signature does guarantee is faster sight-reading: seeing it, a player already knows which notes to read as altered before even running into them, instead of reacting bar by bar.
Reading a key signature on the staff: where the sharps and flats sit
On the staff, a key signature always sits in the same spot: right after the clef, and right before the time signature. It does not appear just once at the start of the piece: it repeats at the start of every new line, all the way through the score, precisely because a player has to be able to find their bearings even starting mid-page. If the key changes partway through a piece, the new signature is usually announced twice, once at the end of the line that is finishing and once at the start of the next one, so the change does not slip past unnoticed.
What stays constant from one instrument to another is the order of the sharps or flats: it never changes, whichever clef is in use. What does change is their vertical position on the staff. In treble clef, the first sharp in a signature, F sharp, is drawn on the very top line of the staff; in bass clef, that same F sharp is drawn on the second line from the top. A pianist reading a treble staff for the right hand and a bass staff for the left hand at the same time sees the identical signature drawn at two different heights on the page, which can be confusing early on, before the eye learns to recognise the shape rather than the exact position.
One thing that often trips up beginners: a sharp or flat drawn at one specific spot in the signature applies to every octave of that note, low and high, including on ledger lines above or below the staff, not only to the exact pitch where the symbol is drawn. A signature with a single sharp therefore alters every F in the piece, whether it is played an octave lower or two octaves higher, even though only one F sharp symbol is physically drawn on the staff.
The order of sharps and flats: F-C-G-D-A-E-B, and its exact reverse
Sharps never show up in a random order: they always follow the same sequence, F, C, G, D, A, E, B. A signature with a single sharp is therefore never anything but an F sharp; a signature with three sharps always carries F sharp, C sharp and G sharp, in that exact order, never a B sharp first. Flats follow the exact reverse order, B, E, A, D, G, C, F: a signature with one flat only ever has a B flat, a signature with three flats has B flat, E flat and A flat.
This order is not arbitrary in the slightest: each new sharp added sits exactly a fifth above the previous one, F to C, C to G, G to D, and so on, which is nothing other than the circle of fifths detailed further down. On the flat side, the logic mirrors it: each new flat sits a fifth below the previous one, or, which comes to the same thing, a fourth above it. It is this link to the fifth that also explains why memorising signatures does not mean learning twenty-four separate lists by heart: one single building rule, applied step by step, generates every signature there is. English-speaking players often lean on a mnemonic sentence built from the initials F-C-G-D-A-E-B, which reads backwards to give the order of the flats; the principle works in any language, only the sentence changes.
The circle of fifths: the map that gives every key signature at once
The circle of fifths arranges the major keys in a circle, each one separated from its neighbour by a perfect fifth, the seven-semitone interval that structures much of Western harmony. Starting from C, with no accidentals at all, and moving up fifth by fifth, you get G, then D, then A, then E, and so on, until you almost land back on C, seven steps later. With every step to the right, a key gains exactly one more sharp; with every step to the left, it gains one more flat. The idea was not born fully formed: a first diagram of this kind appears as early as 1677, in a treatise by the Ukrainian-Russian composer Nikolai Diletsky, and the German theorist Johann David Heinichen published an independent version in 1711 under the name "musical circle", before refining it in his 1728 treatise on figured bass, the version closest to the circle taught today. A few years later, in 1737, another German theorist, David Kellner, proposed adding a second, concentric ring to hold the relative minor of each major key, an improvement that brought the diagram closer to the two-ring versions found in most textbooks today.
The practical value of the circle goes well beyond a simple memory map. Two neighbouring keys on the circle differ by only a single altered note: C major and G major share six notes out of seven, only F becomes F sharp. That closeness is what makes modulating to a neighbouring key sound so natural to the ear, in classical music as much as in songs: the change is minimal, almost imperceptible at the level of the notes, whereas modulating to a key far away on the circle means switching several notes at once.
| Major key | Relative minor | Number of accidentals | Altered notes, in order |
|---|---|---|---|
| C♭ major | A♭ minor | 7 flats | B♭ E♭ A♭ D♭ G♭ C♭ F♭ |
| G♭ major | E♭ minor | 6 flats | B♭ E♭ A♭ D♭ G♭ C♭ |
| D♭ major | B♭ minor | 5 flats | B♭ E♭ A♭ D♭ G♭ |
| A♭ major | F minor | 4 flats | B♭ E♭ A♭ D♭ |
| E♭ major | C minor | 3 flats | B♭ E♭ A♭ |
| B♭ major | G minor | 2 flats | B♭ E♭ |
| F major | D minor | 1 flat | B♭ |
| C major | A minor | 0 | None |
| G major | E minor | 1 sharp | F♯ |
| D major | B minor | 2 sharps | F♯ C♯ |
| A major | F♯ minor | 3 sharps | F♯ C♯ G♯ |
| E major | C♯ minor | 4 sharps | F♯ C♯ G♯ D♯ |
| B major | G♯ minor | 5 sharps | F♯ C♯ G♯ D♯ A♯ |
| F♯ major | D♯ minor | 6 sharps | F♯ C♯ G♯ D♯ A♯ E♯ |
| C♯ major | A♯ minor | 7 sharps | F♯ C♯ G♯ D♯ A♯ E♯ B♯ |
The table runs from seven flats to seven sharps, passing through C major at the centre with no accidentals at all: that covers every key signature commonly used in Western tonal music, each paired with its relative minor. Beyond seven accidentals in either direction, you would need theoretical double sharps or double flats, a complexity that practice almost always avoids by picking the simplest enharmonic spelling instead, which is exactly the subject of the next section.
The relative minor, in brief
Every key signature in the table above is actually shared by two keys, a major one and its relative minor: C major and A minor, for instance, have no accidentals between them at all, exactly the same seven notes, only the resting point changes. That is why the circle-of-fifths table above shows a "relative minor" column next to every major key: knowing the signature is never enough on its own to choose between the two, since it is strictly identical on both sides. The Music Hub guide "Major and minor scales to get off to a good start" explains in detail how this relative minor is worked out, why it shares exactly the same set of notes, and how to find it step by step from any major key; there is no need to repeat that calculation here to understand how a key signature works.
Working out the key from a given signature: the method, step by step
Faced with an unfamiliar signature, two mechanical shortcuts give the name of the major key almost instantly, without having to walk back through the whole circle of fifths. On the sharp side, the rule is to spot the very last sharp on the right of the signature and go up one semitone: with three sharps, F sharp, C sharp, G sharp, the last one is G sharp, a semitone above that gives A, so A major. On the flat side, the rule shifts slightly: from two flats onward, the second-to-last flat gives the name of the major key directly. With four flats, B flat, E flat, A flat, D flat, the second-to-last is A flat, so A flat major. A single flat falls outside this rule, for lack of a second-to-last one: a signature with just one flat is always F major, an exception worth remembering on its own.
Both shortcuts only ever give the name of the major key, never directly that of its relative minor, and certainly never confirm that a piece is really in the major: the signature stays strictly identical either way. To settle it, you have to look beyond the signature itself. The most reliable habit is to listen for the tonic, the note the music genuinely settles on, very often the one carried by the very last chord. A second clue, specific to minor keys, hides in the accidentals of the score itself: a piece in minor almost always shows, here and there and outside the signature, the leading tone of its harmonic minor scale, a sharp added to the seventh degree that appears nowhere in the base signature. Seeing that kind of sharp turn up regularly across the bars, never announced at the clef, is a near-certain signal that the real key is the relative minor rather than the major sharing the same signature.
Enharmonic keys: two names, one sound
On a piano, the black key between F and G stands for both F sharp and G flat: two different names, one single key, one single pitch. This equivalence, called enharmonic, does not stop at a single isolated note: it extends to entire keys. F sharp major and G flat major use exactly the same piano keys from start to finish, yet they are written with completely different signatures, one in sharps, the other in flats.
The number of accidentals in two enharmonic keys follows a simple arithmetic rule: sharps on one side plus flats on the other always add up to twelve. F sharp major, six sharps, and G flat major, six flats, land exactly in the middle, a perfect tie. The further you move from that midpoint, the more the balance tips to one side: C sharp major counts seven sharps where its twin D flat major only counts five flats, and B major carries only five sharps where its twin C flat major needs seven.
| Sharp key | Number of sharps | Equivalent flat key | Number of flats |
|---|---|---|---|
| F♯ major | 6 | G♭ major | 6 |
| B major | 5 | C♭ major | 7 |
| C♯ major | 7 | D♭ major | 5 |
In practice, whenever the gap is clear, musicians almost always pick the lighter spelling to read: D flat major, five flats, replaces C sharp major, seven sharps, in the vast majority of scores, and B major, five sharps, wins out over C flat major, seven flats, in the same way. Taken to the extreme, the arithmetic quickly turns absurd in one direction: a key of G sharp major would need eight sharps, with a double sharp on F thrown in, while its enharmonic equivalent, A flat major, is written cleanly with only four flats; nobody ever writes in G sharp major in practice, despite it being a perfectly valid theoretical key.
This freedom to pick the more readable signature is nothing obvious historically: before the spread of so-called "well" temperaments in the eighteenth century, a keyboard tuned to meantone temperament, the norm at the time, only sounded in tune in five or six keys close to C, and distant keys like C sharp major sounded flatly out of tune on it. It is precisely to demonstrate that a single keyboard could sound in tune across all twenty-four keys, including the most distant ones on the circle of fifths, that Johann Sebastian Bach composed his Well-Tempered Clavier in 1722, a collection of twenty-four preludes and fugues moving chromatically through every major and minor key in turn: the first fully realised demonstration that no key signature, however loaded, was a technical problem any more once the tuning itself had been rethought.
A short history of key-signature notation
Before the major-minor tonal system emerged, Renaissance modal music did not use key signatures in the modern sense. Some voices in a polyphonic piece did carry one or two flats at the clef, a practice musicologists today call a partial signature, but it almost never covered every accidental actually used: the rest was written case by case, accidental by accidental, exactly where it occurred in the score. It was only with the gradual spread of the major-minor system, over the course of the seventeenth century, that the idea of announcing every accidental of a key once and for all, at the head of the staff, took hold as a notational convention.
The shift did not happen all at once overnight. In the earliest part of the Baroque period, a minor key in flats was often written with one fewer flat in its signature than it would carry today: a piece in G minor, for instance, might be written with only a single flat at the clef, where the modern convention calls for two, the missing flat then being added case by case in the score, a direct hangover from the old logic of the partial signature. That variability tightened progressively as the century went on, converging toward the convention still in use today, the one that writes out at the clef the full set of altered degrees of a key, without exception or omission. Bach's Well-Tempered Clavier, in 1722, arrives at a point when this convention is already largely settled: that is exactly what lets it run through all twenty-four possible key signatures, from the emptiest to the most loaded, as a complete repertoire rather than an isolated curiosity.
Once fixed, this convention has barely moved in three centuries: today's music notation software, which draws the key signature automatically the moment a key is chosen, applies the exact same order of sharps and flats theorised back in the Baroque era, F-C-G-D-A-E-B and its reverse. What has changed is not the rule itself but how easy it is to reach: what once took years of solfège practice now fits in a simple dropdown menu, the underlying logic still exactly the one worked out between Heinichen and Bach.
Sight-reading tips for the working musician
For a beginner, decoding a key signature often means mentally running back through the whole list of sharps or flats in order, one by one, until reaching the one that matters. An experienced player skips that step entirely: with enough practice, the very shape of the signature, two sharps huddled at the top of the staff, four flats stepping down like stairs, becomes a shape recognised at a glance, tied directly to the name of the key without ever going back through the counting. That shape recognition is built through repetition, key by key, rather than through some magic shortcut: it pays to drill the most common signatures first, zero, one and two sharps or flats, before tackling the heavier ones.
More good news for anyone starting out: the bulk of pop, folk and song repertoire clusters around a handful of the simplest signatures, from zero to three sharps or flats; drilling those first already covers most of what a player will run into in practice, well before the five- or six-accidental keys that show up mostly in jazz and classical music.
Before playing the very first note of an unfamiliar piece, the useful habit is to scan the signature and ask concretely which notes it affects on your own instrument: a guitarist thinks in fretboard positions, a pianist in black keys, a saxophonist in fingerings. That short moment of preparation heads off the missed sharp or flat in the middle of a fast passage, the most common sight-reading mistake, and by far more frequent than a rhythm error.
For transposing instruments, the vigilance doubles: an alto saxophonist or a clarinettist never reads the signature of the key actually being heard, but the one written for their instrument, usually several sharps or flats away from it. The Music Hub guide "Saxophone transposition: reading a chart in Bb or Eb" details this mechanism for Bb and Eb instruments. A guitarist placing a capo also changes the key actually sounding without changing a single fret they play or the signature written on their chart: two reference points that should never be confused, the one under the hand and the one in the ear.
Common pitfalls to avoid
MistakeMixing up the key signature, fixed for the whole piece, with an accidental, local and one-off.
Why — Both use the same symbol, a sharp or a flat, which keeps the confusion alive. But the key signature, placed once at the start of every line, applies to the whole piece and to every octave of a given note, whereas an accidental, written directly in front of a note within a bar, only holds for that one bar, sometimes only for that one occurrence.
Do this instead : Always check where the symbol sits: at the start of a line, right after the clef, it is the key signature and it lasts the whole piece; sitting right against a note in the middle of a bar, it is an accidental that only lasts as long as that bar.
MistakeAssuming an empty signature, with no sharps or flats, automatically means the piece is in C major.
Why — An empty signature is strictly identical for C major and for its relative A minor, and nothing in the signature itself allows you to choose between the two. An empty signature also does not rule out plenty of accidentals if the piece modulates or borrows chromatic notes along the way.
Do this instead : Listen for the real tonic of the piece, usually the very last chord, before concluding anything. An empty signature that ends on an A minor chord signals a minor key despite carrying no sharps or flats at the clef at all.
MistakeThinking that the sharp or flat in a key signature only applies at the exact pitch where it is drawn on the staff.
Why — The symbol is only drawn once per note name, yet it holds for absolutely every octave of that note in the piece, low or high, including on ledger lines. Ignoring this rule leads to playing a natural note where it should stay altered, the moment it shifts octave.
Do this instead : Treat every symbol in the key signature as a rule for the whole note name, not for one exact spot on the staff: an F sharp in the signature alters every F in the piece, with no octave exception.
MistakeAssuming sharps and flats appear in the same order within a key signature.
Why — Sharps follow the order F, C, G, D, A, E, B, while flats follow the exact reverse order, B, E, A, D, G, C, F. Applying the sharp order to read a flat signature, or the other way round, leads to guessing the wrong altered notes.
Do this instead : Memorise the two orders separately, or simply remember that they are exact mirror images of each other: if you know the sharp order by heart, read it backwards to get the flat order.
MistakeApplying the last-sharp-plus-a-semitone rule, or the second-to-last-flat rule, and stopping there without checking whether the piece might actually be in the relative minor.
Why — Both shortcuts only ever give the name of the major key matching a given signature; they never say whether the piece is really in that major key or in its relative minor, since the signature alone cannot settle that question.
Do this instead : Use these shortcuts to quickly narrow things down to the pair of possible keys, then confirm which of the two is correct by listening for the real tonic or by spotting the accidental leading tone typical of the harmonic minor.
Explore in the Music Hub
More guides
It is all in the app, for free
The Music Hub gathers over 2 597 songs with chords, click-to-hear piano, transposition and a capo helper. Free, no account required.
Open the Music Hub →Frequently asked questions
What's the difference between a key and a key signature?
A key is a set of seven notes built around a tonic, the resting note of the piece; it can be major or minor. A key signature is just a graphic shortcut: the group of sharps or flats placed at the start of every staff line to announce, once and for all, which notes are altered throughout the piece. The same signature, too, is always shared by two keys, a major one and its relative minor.
In what order do sharps, then flats, appear in a key signature?
Sharps always appear in the order F, C, G, D, A, E, B. Flats follow the exact reverse order, B, E, A, D, G, C, F. This order isn't arbitrary: each new sharp sits a fifth above the previous one, exactly the logic behind the circle of fifths.
How do you find the name of a major key from its signature?
For a sharp signature, go up a semitone above the very last sharp: with three sharps, the last one is G sharp, a semitone higher gives A major. For a signature with at least two flats, the key name is directly the second-to-last flat. With a single flat, it's always F major, an exception worth knowing by heart.
What is the circle of fifths?
It's a circular diagram that arranges the twelve major keys by successive fifths, starting from C: every step to the right adds a sharp, every step to the left adds a flat. It's used to find or memorise the signature of any key without having to learn each one separately.
What are two enharmonic keys, like F sharp major and G flat major?
They're two keys that sound exactly the same, use the same keys on a keyboard, but are written with different note names and different signatures, one in sharps, the other in flats. Musicians generally pick whichever spelling has fewer accidentals and is simpler to read.
Does an empty signature, with no sharps or flats, mean a piece is in C major?
Not necessarily: an empty signature fits C major just as well as its relative A minor, which shares the exact same signature. You need to listen for the real tonic, often the last chord of the piece, to settle between the two.