Key Signature Calculator

Find the major key from the number of sharps or flats.

Major key D major
Relative minor B minor

Formula: Circle of fifths lookup

Step-by-step with your numbers:
1. Values used:
2. Number of accidentals = 2
3.
4. Major key = D major
5. Relative minor = B minor
Did we solve your problem today?

The number of sharps or flats identifies the key via the circle of fifths.

How the Math Works

The Key Signature Calculator uses the Circle of Fifths, a mathematical sequence that arranges musical keys by their relationship through perfect fifths. Starting from the key of C major (0 sharps/flats), each clockwise step adds one sharp (moving through G, D, A, E, B, F#, and D#), while counter-clockwise steps add one flat (moving through F, Bb, Eb, Ab, Db, and Gb). This creates a cyclical pattern where 7 sharps equals 5 flats (enharmonic equivalence), making it a finite lookup table rather than a complex formula.

Practical Applications

To use the calculator, simply enter the number of sharps (positive numbers) or flats (negative numbers) in your key signature, and it will return the corresponding major key. For example, inputting 3 sharps returns A major, while -4 flats returns Bb major. This eliminates the need to manually count accidentals or memorize the circle, providing instant results for key signature identification.

Day-to-Day Use

This calculator is invaluable for musicians in daily practice, such as when sight-reading sheet music, composing new pieces, or transcribing songs. It saves time during rehearsals by quickly confirming the key signature, helps students master theory concepts more efficiently, and prevents common mistakes when working with keys that have multiple sharps or flats. Whether you're a beginner learning the basics or a professional verifying complex scores, this tool streamlines your musical workflow.

Worked example

2 sharps is D major (B minor).

FAQ

What is a relative minor?

The minor key that shares the same key signature, a minor third below the major.