This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Key signature" – news ·newspapers ·books ·scholar ·JSTOR(May 2025) (Learn how and when to remove this message) |
InWesternmusical notation, akey signature is a set ofsharp (♯),flat (♭), or rarely,natural (♮) symbols placed on thestaff at the beginning of a section of music. The initial key signature in a piece is placed immediately after theclef at the beginning of the first line. If the piece contains a section in a differentkey, the new key signature is placed at the beginning of that section.
In a key signature, a sharp or flat symbol on a line or space of the staff indicates that thenote represented by that line or space is to be played asemitone higher (sharp) or lower (flat) than it would otherwise be played. This applies through the rest of the piece or until another key signature appears. Each symbol applies to comparable notes in alloctaves—for example, a flat on the fourth space of thetreble staff (as in the diagram) indicates that all notes notated asEs are played asE-flats, including those on the bottom line of the staff.
Most of this article addresses key signatures that represent thediatonic keys of Western music. These contain either flats or sharps, but not both, and the different key signatures add flats or sharps according to the order shown in thecircle of fifths.
Eachmajor andminorkey has an associated key signature, showing up to seven flats or seven sharps, that indicates the notes used in its scale. Music was sometimes notated with a key signature that did not match its key in this way—this can be seen in someBaroque pieces,[1] or transcriptions of traditionalmodalfolk tunes.[2]


With any note as a starting point, a certain series ofintervals produces amajor scale: whole step, whole, half, whole, whole, whole, half.
Starting on C, this yields C-D-E-F-G-A-B-C (a C-major scale). There are no sharps or flats in this scale, so the key signature for C has no sharps or flats in it. Starting on any other note requires that at least one of these notes be changed (raised or lowered) to preserve the major scale pattern. These raised or lowered notes form the key signature. Starting the pattern on D, for example, yields D-E-F♯-G-A-B-C♯-D, so the key signature for D major has two sharps—F♯ and C♯.
Key signatures indicate that this applies to the section of music that follows, showing the reader which key the music is in, and making it unnecessary to apply accidentals to individual notes.
In standardmusic notation, the order in which sharps or flats appear in key signatures is uniform, following thecircle of fifths: F♯, C♯, G♯, D♯, A♯, E♯, B♯, and B♭, E♭, A♭, D♭, G♭, C♭, F♭. Musicians can identify the key by the number of sharps or flats shown, since they always appear in the same order. A key signature with one sharp must showF-sharp,[3] which indicatesG major orE minor.
There can be exceptions to this, especially in 20th-century music, if a piece uses an unorthodox or synthetic scale and an invented key signature to reflect that. This may consist of sharps or flats that are not in the usual order, or of sharps combined with flats (e.g., F♯ and B♭). Key signatures of this kind can be found in the music ofBéla Bartók, for example.
In a score,transposing instruments will show a different key signature to reflect their transposition but their music is in the same concert key as the other instruments. Percussion instruments with indeterminate pitch will not show a key signature, andtimpani parts are sometimes written without a key signature (early timpani parts were sometimes notated with the high drum as "C" and the low drum a fourth lower as "G", with actual pitches indicated at the beginning of the music, e.g., "timpani in D–A"). Inpolytonal music, where different parts are actually in different keys sounding together, instruments may be notated in different keys.

The order in which sharps or flats appear in key signatures is illustrated in the diagram of thecircle of fifths. Starting the major scale pattern (whole step, whole, half, whole, whole, whole, half) on C requires no sharps or flats. Proceeding clockwise in the diagram starts the scale a fifth higher, on G. Starting on G requires one sharp, F♯, to form a major scale. Starting another fifth higher, on D, requires F♯ and C♯. This pattern continues, raising the seventh scale degree of each successive key. As the scales become notated in flats, this is shown by eliminating one of the flats. This is strictly a function of notation—the seventh scale degree is still being raised by a semitone compared to the previous key in the sequence. Going counter-clockwise from C results in lowering the fourth scale degree with each successive key (starting on F requires a B♭ to form a major scale). Each major key has a relative minor key that shares the same key signature. The relative minor is always aminor third lower than its relative major.
The key signatures with seven flats and seven sharps are usually notated in their enharmonic equivalents.C♯ major (seven sharps) is usually written asD♭ major (five flats) andC♭ major is usually written asB major.

The key signature may be changed at any time in a piece by providing a new signature. If the new signature has no sharps or flats, a signature of naturals, as shown, is used to cancel the preceding signature. If a change in signature occurs at the start of a new line on the page, where a signature would normally appear, the new signature is customarily repeated at the end of the previous line to make the change more conspicuous.
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(May 2025) (Learn how and when to remove this message) |
When a key signature changes from sharps to flats or vice versa, the old key signature can be cancelled with a matching set of naturals before the new key signature is shown. This was a frequent convention in older notation styles but newer music and newer editions of old music sometimes simply show the new signature without the canceling naturals. These naturals are necessary, however, if the new key signature has no sharps or flats (C major, A minor, or an open key signature).
Similarly, when a flat key changes to fewer flats, or a sharp key changes to fewer sharps, the older convention was to use naturals to cancel the flats or sharps being eliminated before the new signature is written. Modern usage often simply shows the new signature without these naturals. The use of natural signs is still required if the new key signature has no sharps or flats.
When a flat key changes to more flats or a sharp key changes to more sharps, the new signature is simply written in without using naturals to cancel the old signature. This convention applies in both traditional and newer styles.
At one time it was usual to precede the new signature with adouble barline even if it was not otherwise required, but it has become increasingly common to simply use a single barline. The courtesy signature that appears at the end of a line immediately before a change is usually preceded by an additional barline and the line at the very end of the staff is omitted.
If both naturals and a new key signature appear at a key signature change, there are also modern variations about where a barline will be placed. In some scores by Debussy the barline is placed after the naturals but before the new key signature. Hitherto, it would have been usual to place all the symbols after the barline.
The A♯ which is the fifth sharp in the sharp signatures may occasionally be notated on the top line of the bass staff, whereas it is more usually found in the lowest space on that staff. An example of this can be seen in the full score ofOttorino Respighi'sPines of Rome, in the third section, "Pines of the Janiculum" (which is inB major), in the bass-clef instrumental parts.
In the case of seven-flat key signatures, the final F♭ may occasionally be seen on the second-top line of the bass staff, whereas it would more usually appear on the space below the staff. An example of this can be seen inIsaac Albéniz'sIberia: first movement, "Evocación", which is inA♭ minor.
Key signatures can extend intodouble flats ordouble sharps, but this is extremely rare. For example, the key ofG♯ major would have eight sharps, requiring an F double-sharp (F
) and six single sharps. The key ofA♭ major, with four flats, isenharmonically equivalent and would generally be used instead. Although the notation of key signatures could theoretically extend beyond single flats or sharps, a key signature with more than one or two double flats or sharps would be exceedingly hard to read and would be replaced by the enharmonically equivalent key signature.
| Major | Key signature | Minor |
|---|---|---|
| F♭ major (E major) | 8 flats (4 sharps) | D♭ minor (C♯ minor) |
| B | 9 flats (3 sharps) | G♭ minor (F♯ minor) |
| E | 10 flats (2 sharps) | C♭ minor (B minor) |
| A | 11 flats (1 sharp) | F♭ minor (E minor) |
| D | 12 flats (no sharps or flats) | B |
| G | 13 flats (1 flat) | E |
| C | 14 flats (2 flats) | A |
| G♯ major (A♭ major) | 8 sharps (4 flats) | E♯ minor (F minor) |
| D♯ major (E♭ major) | 9 sharps (3 flats) | B♯ minor (C minor) |
| A♯ major (B♭ major) | 10 sharps (2 flats) | F |
| E♯ major (F major) | 11 sharps (1 flat) | C |
| B♯ major (C major) | 12 sharps (no flats or sharps) | G |
| F | 13 sharps (1 sharp) | D |
| C | 14 sharps (2 sharps) | A |
A piece in a major key might modulate up afifth to thedominant (a common occurrence in Western music), resulting in a new key signature with an additional sharp. If the original key was C-sharp, such amodulation would lead to the key of G-sharp major (with eight sharps) requiring an F
in place of the F♯. This section could be written using the enharmonically equivalent key signature of A-flat major instead.Claude Debussy'sSuite bergamasque does this: in the third movement "Clair de lune" the key shifts from D-flat major to D-flat minor (eight flats) for a few measures but the passage is notated in C-sharp minor (four sharps); the same happens in the final movement, "Passepied", in which a G-sharp major section is written as A-flat major.
Such passages may instead be notated with the use of double-sharp or double-flat accidentals, as in this example fromJohann Sebastian Bach'sWell-Tempered Clavier, which has this passage in G-sharp major in measures 10-12.
While these keys are sometimes notated with accidentals as in this example, the use of a key signature containing double flats or sharps is very rare. The final pages ofJohn Foulds'A World Requiem are written inG♯ major (with F
in the key signature), No. 18 ofAnton Reicha'sPractische Beispiele is written in B♯ major, and the third movement ofVictor Ewald'sBrass Quintet Op. 8 is written inF♭ major (with B
in the key signature).[4][5]
Examples of such key signatures are pictured below:

There does not appear to be a standard on how to notate these key signatures:
Intuning systems where the number of notes per octave is not a multiple of 12, notes such as G♯ and A♭ are not enharmonically equivalent, nor are the corresponding key signatures. These tunings can produce keys with no analogue in 12-tone equal temperament, which can require double sharps, double flats, ormicrotonal alterations in key signatures. For example, the key of G♯ major, with eight sharps, is equivalent to A♭ major in 12-tone equal temperament, but in19-tone equal temperament, it is equivalent to A
major instead, with 11 flats.
There can be up to seven sharps in a key signature, appearing in this order:F♯ C♯ G♯ D♯ A♯ E♯ B♯.[9][10] The key note ortonic of a piece in a major key is a semitone above the last sharp in the signature.[11] For example, the key of D major has a key signature of F♯ and C♯, and the tonic (D) is a semitone above C♯. Each scale starting on thefifthscale degree of the previous scale has one new sharp, added in the order shown.[10]
| Major key | Number of sharps | Sharp notes | Minor key | Enharmonic equivalent |
|---|---|---|---|---|
| C major | 0 | – | A minor | None |
| G major | 1 | F♯ | E minor | |
| D major | 2 | F♯, C♯ | B minor | |
| A major | 3 | F♯, C♯, G♯ | F♯ minor | |
| E major | 4 | F♯, C♯, G♯, D♯ | C♯ minor | |
| B major | 5 | F♯, C♯, G♯, D♯, A♯ | G♯ minor | C♭ major/A♭ minor |
| F♯ major | 6 | F♯, C♯, G♯, D♯, A♯, E♯ | D♯ minor | G♭ major/E♭ minor |
| C♯ major | 7 | F♯, C♯, G♯, D♯, A♯, E♯, B♯ | A♯ minor | D♭ major/B♭ minor |
There can be up to seven flats in a key signature, applied as:B♭ E♭ A♭ D♭ G♭ C♭ F♭[9][10] The major scale with one flat is F major. In all major scales with flat key signatures, the tonic in a major key is a perfect fourth below the last flat. When there is more than one flat, the tonic is the note of the second-to-last flat in the signature.[11] In the major key with four flats (B♭ E♭ A♭ D♭), for example, the second to last flat is A♭, indicating a key of A♭ major. Each new scale starts a fifthbelow (or afourth above) the previous one.
| Major key | Number of flats | Flat notes | Minor key | Enharmonic equivalent |
|---|---|---|---|---|
| C major | 0 | – | A minor | None |
| F major | 1 | B♭ | D minor | |
| B♭ major | 2 | B♭, E♭ | G minor | |
| E♭ major | 3 | B♭, E♭, A♭ | C minor | |
| A♭ major | 4 | B♭, E♭, A♭, D♭ | F minor | |
| D♭ major | 5 | B♭, E♭, A♭, D♭, G♭ | B♭ minor | C♯ major/A♯ minor |
| G♭ major | 6 | B♭, E♭, A♭, D♭, G♭, C♭ | E♭ minor | F♯ major/D♯ minor |
| C♭ major | 7 | B♭, E♭, A♭, D♭, G♭, C♭, F♭ | A♭ minor | B major/G♯ minor |
The sharps or flats needed to produce adiatonic scale indiatonic ortonal music can be shown as a key signature at the beginning of a section of music instead of showing accidentals on individual notes. While the key of a piece generally corresponds to the notated key signature, it may not in some cases, such as in pre-Baroque music, which was composed before the modern concept of keys had fully emerged.
Some pieces featuremodulations, or changes in key, between contrasting sections. Modulations may or may not be reflected by a corresponding change in key signature. Modulated passages may instead make use of accidentals.

TheToccata and Fugue in D minor, BWV 538 byBach has a key signature with no sharps or flats, indicating that it may be in D, inDorian mode, but the B♭s indicated withaccidentals make the music in D minor.
This section has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
Keys which are associated with the same key signature are calledrelative keys.
Whenmusical modes, such asLydian or Dorian, are written using key signatures, they are calledtransposed modes.
Key signatures are also used in music that does not come from the Westerncommon practice period. This includes folk music, non-Western music, and Western music from before or after the common practice period.
Klezmer music uses scales other than diatonic major or minor, such asPhrygian dominant scale. Because of the limitations of theGreat Highland Bagpipe scale, key signatures are often omitted from written pipe music, which otherwise would be written with two sharps, F♯ and C♯.[12] (The pipes are incapable of playing F♮ and C♮ so the sharps are not notated.) 20th century composers such asBartók andRzewski (see below) experimented with non-diatonic key signatures.

In music from the Baroque period, it is common to see key signatures in which the notes are annotated in a different order from the modern practice, or with the same note-letter annotated for each octave.
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(May 2025) (Learn how and when to remove this message) |
The 15 key signatures that form diatonic scales are sometimes calledstandard key signatures. Other scales are written either with a standard key signature and use accidentals as required, or with a nonstandard key signature. Examples of the latter include the E♭ (right hand), and F♯ and G♯ (left hand) used for the С diminished (Сoctatonic) scale in Bartók'sCrossed Hands (no. 99, vol. 4,Mikrokosmos); the B♭, E♭ and F♯ used for the DPhrygian dominant scale inFrederic Rzewski'sGod to a Hungry Child; and the E♭ and D♭ (right hand) and the B♭, A♭, G♭ (left hand) inGyörgy Ligeti'sGalamb Borong (no. 7 from the second book of theÉtudes pour piano), and B♭, E♭, D♭, G♭ (both hands) inPour Irina (no. 16 from the same work's third book).
There are also examples of conflicting standard signatures, as in:
No sharps or flats in a key signature can indicate that the music is in the key of C major / A minor, or that the piece ismodal oratonal (does not have a key signature). An example is Bartók'sPiano Sonata, which has no fixed key and is highly chromatic.
The use of a one-flat signature developed in theMedieval period, but signatures with more than one flat did not appear until the 16th century, and signatures with sharps not until the mid-17th century.[13]
When signatures with multiple flats first came in, the order of the flats was not standardized, and often a flat appeared in two different octaves, as shown at right. In the late 15th and early 16th centuries, it was common for different voice parts in the same composition to have different signatures, a situation called apartial signature orconflicting signature. This was actually more common than complete signatures in the 15th century.[14] The 16th-century motetAbsolon fili mi byPierre de La Rue (formerly attributed toJosquin des Prez) features two voice parts with two flats, one part with three flats, and one part with four flats.
Baroque music written inminor keys often was written with a key signature with fewer flats than we now associate with their keys; for example, movements in C minor often had only two flats (because the A♭ would frequently have to be sharpened to A♮ in theascending melodic minor scale, as would the B♭).
|

Bagpipe music nominally uses the key of D Major (even though that isn't really true). However, since that is the only key that can be used, the key signature is normally not written out.