# Key Signature Calculator

URL: https://speedycalculator.com/calculators/other/key-signature/
Last updated: 2026-11-08

> The key signature calculator finds the major and relative minor key for a number of sharps or flats, or gives the sharps or flats of any major or minor key in order, with its scale, enharmonic equivalent and a circle of fifths highlighting the key.

## Inputs

- I want to find…
- Number of sharps or flats
- They are
- Key quality
- Tonic (root note)

## Results

- Result
- Major key
- Relative minor key
- Key signature
- Accidentals in order
- Number of accidentals
- Scale of the key
- Theoretical key
- Enharmonic equivalent
- Circle of fifths

## Formula

```
Sharps in order: F♯ C♯ G♯ D♯ A♯ E♯ B♯ · flats: B♭ E♭ A♭ D♭ G♭ C♭ F♭
Each step clockwise on the circle of fifths adds one sharp (or removes one flat)
Relative minor = major tonic − minor third (down 3 semitones)
```

## Explanation

A key signature is the group of sharps or flats written at the start of every staff. It tells the player which notes are raised or lowered throughout the piece and, together with the music itself, which key it is in. There are fifteen standard key signatures: C major (no accidentals), seven with sharps and seven with flats. Each signature belongs to one major key and its relative minor, which share the same notes: C major and A minor, G major and E minor, and so on.

Sharps are always added in the order F–C–G–D–A–E–B and flats in the reverse order B–E–A–D–G–C–F (“Father Charles Goes Down And Ends Battle”). Two quick rules name the key: with sharps, the major key is a semitone above the last sharp; with flats, it is the second-to-last flat (one flat is F major).

Keys that would need more than seven accidentals, such as G♯ major (eight sharps, including F𝄪), are called theoretical. They appear in analysis but are normally written in their enharmonic equivalent, here A♭ major. The calculator shows those too.

### How to use the Key Signature Calculator

- **I want to find…**
- **Number of sharps or flats**
- **They are**
- **Key quality**
- **Tonic (root note)**

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

Every key has a position on the circle of fifths: C = 0, G = +1 (one sharp), F = −1 (one flat), and each sharp or flat on the tonic adds 7 positions. A minor key sits three positions lower than the major key on the same tonic. The position gives the number of accidentals, which are listed in their fixed order.

### Worked example

Three sharps are F♯, C♯ and G♯. The last sharp is G♯, and a semitone above it is A, so the key is **A major**; down a minor third from A gives its relative minor, **F♯ minor**. In the other direction, C minor sits three steps anticlockwise from C major on the circle of fifths, giving three flats: B♭, E♭, A♭.

### All 15 key signatures

SignatureMajor keyMinor keynoneCA1♯GE2♯DB3♯AF♯4♯EC♯5♯BG♯6♯F♯D♯7♯C♯A♯1♭FD2♭B♭G3♭E♭C4♭A♭F5♭D♭B♭6♭G♭E♭7♭C♭A♭

## Worked example

Inputs: I want to find…: The key from a number of sharps or flats; Number of sharps or flats: 3; They are: Sharps (♯).

Results: **Result = A major or F♯ minor**; Major key = A major; Relative minor key = F♯ minor; Key signature = 3 sharps; Accidentals in order = F♯, C♯, G♯; Number of accidentals = 3.

## Key terms

- **Key signature**: Sharps or flats at the start of each staff that apply to the whole piece.
- **Relative keys**: A major and minor key sharing the same signature (C major and A minor).
- **Parallel keys**: A major and minor key on the same tonic (C major and C minor).
- **Circle of fifths**: The twelve keys arranged in perfect fifths, each one accidental apart.
- **Theoretical key**: A key that would need more than seven sharps or flats.

## FAQ

**What key has three sharps?**
A major or its relative minor F♯ minor (F♯, C♯, G♯).

**What key has six flats?**
G♭ major or E♭ minor (B♭, E♭, A♭, D♭, G♭, C♭); its enharmonic equivalent is F♯ major with six sharps.

**How many sharps does D major have?**
Two: F♯ and C♯.

**What is the relative minor of D major?**
B minor: go down a minor third from D. Both have two sharps.

**How do I name a key from its sharps?**
Go up a semitone from the last sharp: the last of F♯, C♯, G♯, D♯ is D♯, so the key is E major (or C♯ minor).

**How do I name a key from its flats?**
The second-to-last flat is the key: B♭, E♭, A♭ → E♭ major (or C minor). One flat is F major.

**What is the key signature of C minor?**
Three flats (B♭, E♭, A♭), the same as E♭ major.

**Why is there no G♯ major key signature?**
It would need eight sharps including F𝄪; composers write it as A♭ major (four flats) instead.


## Sources

- [musictheory.net: Lessons (notes, intervals, chords, keys)](https://www.musictheory.net/lessons)
- [Open Music Theory (open textbook)](https://viva.pressbooks.pub/openmusictheory/)
- [Wikipedia: Key signature](https://en.wikipedia.org/wiki/Key_signature)
