Skip to content
Other

Key Signature Calculator

Enter a key and mode to instantly see its sharps or flats, the names of the accidentals in order, the seven scale notes, and the relative major or minor key. Or work the other way: enter a count of sharps or flats to identify which major and minor keys use that signature. All results follow standard music theory rules and the circle of fifths.

Your details

Switch between the two calculation directions.
Is the key signature written with sharps or flats?
Enter 0 for C major / A minor (no accidentals), up to 7.
Key signature
2 sharps: F#, C#

Number and type of accidentals in the signature

Major keyD
Relative minor keyB
Accidentals in orderF# - C#
Scale notesD, E, F#, G, A, B, C#
Circle of fifths position2 steps clockwise from C
Accidental count2
2 accidentals
Simple (0-1)<1Moderate (2-3)1-3Advanced (4-5)3-5Complex (6-7)5+

2 sharps: F#, C# identifies D major and B minor

  • The major key is D major and the relative natural minor is B minor. They share exactly the same set of notes.
  • Scale notes in order: D, E, F#, G, A, B, C#.
  • Accidentals appear on the staff in this order: F# - C#.
  • Circle of fifths: 2 steps clockwise from C.

Next stepThe natural minor uses the same key signature as its relative major. For harmonic or melodic minor, raise the 7th (and also the 6th for melodic) when ascending.

What is a key signature?

A key signature is a set of sharp (#) or flat (b) symbols placed at the beginning of every staff line in a piece of sheet music, immediately after the clef. It tells the performer that every occurrence of certain notes should be played a semitone higher (sharps) or lower (flats) than the natural pitch, without needing individual accidentals on every note. For example, the key of G major has one sharp on the F line, meaning every F in the piece is played as F# unless marked otherwise. Key signatures exist for all 15 major and 15 minor keys (including enharmonic equivalents), though in practice only keys up to 7 sharps or 7 flats appear in standard notation.

The circle of fifths explained

The circle of fifths is the most important diagram in music theory for key signatures. It arranges all 12 major keys (and their relative minors) around a clock face. Starting at C major at the top (no accidentals), each clockwise step raises the key by a perfect fifth and adds one sharp. G major (1 sharp) is at 1 o'clock, D major (2 sharps) at 2 o'clock, and so on up to C# major with 7 sharps. Moving counter-clockwise, each step adds one flat: F major (1 flat) at 11 o'clock, Bb major (2 flats) at 10 o'clock, down to Cb major with 7 flats. Keys at the bottom of the circle - F#/Gb, C#/Db, B/Cb - are enharmonically equivalent, meaning they sound identical but are written differently.

How to identify a key from its sharps or flats

Two simple rules let you name the major key from its accidentals without a chart. For sharp keys: the last sharp in the key signature is always the 7th degree (leading tone) of the major scale, so the key name is one half step above that last sharp. For example, if the last sharp is C#, go up one half step to D, so the key is D major. For flat keys: the major key is named after the second-to-last flat in the signature. If the flats are Bb and Eb, the second-to-last is Bb, so the key is Bb major. The one exception is F major, which has only one flat (Bb) and cannot use the penultimate-flat rule. Once you know the major key, the relative natural minor is always a minor third (3 semitones) lower, or equivalently on the 6th degree of the major scale.

Order of sharps and flats - the mnemonics

Sharps and flats always appear in the same fixed order on the staff, regardless of how many are used. The order of sharps is F, C, G, D, A, E, B, remembered with the phrase "Father Charles Goes Down And Ends Battle." The order of flats is the exact reverse - B, E, A, D, G, C, F - remembered with "Battle Ends And Down Goes Charles Father." This means a key with 4 sharps always has F#, C#, G# and D# (the first four sharps in order), and a key with 3 flats always has Bb, Eb and Ab (the first three flats in order). These mnemonics encode the circle of fifths: each consecutive sharp moves up a fifth, and each consecutive flat moves down a fifth.

Relative major and minor keys

Every major key has a relative natural minor key that uses exactly the same set of notes and the same key signature. The relative minor starts on the 6th degree of the major scale, which is a minor third (3 semitones) below the major root. D major (2 sharps: F#, C#) has B minor as its relative - both keys contain only the notes D, E, F#, G, A, B, C#. To find the relative major from a minor key, go up a minor third (3 semitones) from the minor root. Composers use this relationship frequently: a piece in G major may briefly modulate to E minor without any key-signature change, because the two keys share the same pool of notes.

Circle of fifths - all major and minor key signatures

AccidentalsMajor keyRelative minorAccidental notes
0CANone
1 sharpGEF#
2 sharpsDBF#, C#
3 sharpsAF#F#, C#, G#
4 sharpsEC#F#, C#, G#, D#
5 sharpsBG#F#, C#, G#, D#, A#
6 sharpsF#D#F#, C#, G#, D#, A#, E#
7 sharpsC#A#F#, C#, G#, D#, A#, E#, B#
1 flatFDBb
2 flatsBbGBb, Eb
3 flatsEbCBb, Eb, Ab
4 flatsAbFBb, Eb, Ab, Db
5 flatsDbBbBb, Eb, Ab, Db, Gb
6 flatsGbEbBb, Eb, Ab, Db, Gb, Cb
7 flatsCbAbBb, Eb, Ab, Db, Gb, Cb, Fb

Standard key signatures with their accidentals. Sharps ascend clockwise; flats ascend counter-clockwise. Relative minors share the same signature as the major key in the same row.

Frequently asked questions

How do I find the key of a piece of music?

Look at the key signature at the start of the staff, just after the clef symbol. Count the sharps or flats and use this calculator (Key Finder mode) to identify the major and minor keys. Then check the last chord or note of the piece - if it resolves to the tonic of the major key, the piece is in major; if it resolves to the relative minor, the piece is likely in minor.

What is the difference between a major and a minor key with the same signature?

They share all the same notes but start on different roots, giving them a completely different character. D major and B minor both use F# and C#, but D major feels bright and resolved when centered on D, while B minor feels darker when centered on B. The two keys are called "relative" major and minor. Composers often move between them in a single piece without changing the key signature.

Why are there enharmonic keys like F# and Gb?

F# major (6 sharps) and Gb major (6 flats) produce identical pitches on a piano but are notated differently. At the bottom of the circle of fifths, both spellings are in use, and performers and composers choose whichever is easier to read in context. Keys with 7 sharps (C# major) or 7 flats (Cb major) are less common, since their enharmonic equivalents (Db and B) have fewer accidentals.

What is the relative minor, and how do I find it?

The relative minor is the natural minor key that shares the same key signature as a given major key. To find it, count down 3 semitones (a minor third) from the major root. G major has one sharp (F#), so its relative minor is E minor, which also uses one sharp. E is a minor third below G. Alternatively, the relative minor always starts on the 6th note of the major scale.

Do sharps and flats appear in a random order on the staff?

No - the order is always fixed. Sharps appear as F#, C#, G#, D#, A#, E#, B# (remembered with "Father Charles Goes Down And Ends Battle"), and flats appear as Bb, Eb, Ab, Db, Gb, Cb, Fb ("Battle Ends And Down Goes Charles Father"). This order never changes, so a key with 3 sharps always shows F#, C# and G#, and a key with 4 flats always shows Bb, Eb, Ab and Db.

What does it mean when a piece has no key signature?

No key signature means the piece is written in C major or A minor, both of which use only natural notes (no sharps or flats). It does not mean the piece has no key - it just happens to be the key that requires zero accidentals in the signature. Individual accidentals may still appear within the music to create chords or melodic color.

Can a piece change key signatures mid-way through?

Yes. A key change (modulation) is shown by a new key signature placed on the staff, sometimes preceded by natural signs that cancel the previous accidentals. Temporary key areas that return quickly are often handled with individual accidentals rather than a full key-signature change.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…