🏠
🏠 Home & living

Key Signature Calculator (sharps & flats, relative and parallel keys)

Results update as you type.

Your numbers

Understanding the key signature calculator — concept and principle

This calculator shows the key signature of any major or minor key: how many sharps or flats it has, which ones in order, and its relative, parallel and enharmonic keys. Music students use it for theory homework; players use it to read and transpose music.

Around the circle of fifthsAround the circle of fifths: C → G → D two steps clockwise, F♯ C♯ sharps in order → 2 sharps relative minor: B minorAround the circle of fifthsC → G → Dtwo steps clockwiseF♯ C♯sharps in order2 sharpsrelative minor: B minor
Around the circle of fifths: with the default inputs the result is 2 sharps (relative minor: B minor).

How it is calculated

The principle

A major scale has a fixed pattern of whole and half steps. Starting the pattern on a new note forces some notes to be raised or lowered, and the key signature lists those changes once at the start of each staff. Moving up a fifth keeps six of the seven notes and raises one by a semitone, which is why each step round the circle of fifths adds exactly one sharp. Moving down a fifth adds a flat instead. A minor key and its relative major use the same seven notes, so they share a signature.

Worked example

Default input: D major.

  1. D is two steps clockwise from C (C → G → D), so the signature is 2♯: 2 sharps, 0 flats.
  2. The first two sharps in order: F♯ C♯.
  3. Relative minor: a minor third below D is B, so B minor.
  4. Parallel key: D minor (one flat).
  5. Enharmonic equivalent: D major has only 2 sharps, so none (—).

How to read the result

When you see two sharps at the start of a piece, it is in D major or B minor; look at the last chord and the bass to decide which. The signature applies to every octave of those notes unless an accidental changes it. Keys with many accidentals are often rewritten in their enharmonic twin to make reading easier.

Common mistakes

Keep in mind: Some modern and non-Western music uses non-standard signatures or none at all. This calculator covers standard major and minor keys.

Frequently asked questions

How many sharps are in D major?

Two: F♯ and C♯.

What is the relative minor of D major?

B minor, which shares the same two sharps.

What is the order of sharps?

F, C, G, D, A, E, B; flats are the same letters in reverse.

Sources: S. Kostka, D. Payne & B. Almén, Tonal Harmony, 8th ed. (McGraw-Hill, 2018), ch. 1 (key signatures and the circle of fifths)

Checked 9 Nov 2026. Major and minor key signatures and the circle of fifths — standard music theory as taught in common-practice harmony textbooks (order of sharps F C G D A E B; flats in reverse).

🏠 All home & living tools →🌍 Calculators by country →