I have a very basic understanding of keys / scales and am a keyboard hobbyist. Every now and then I try to find the notes of a song by ear. The problem I sometimes face is with identifying key/scale of the song, after having found all the notes (hopefully correctly), especially when there are accidentals involved.

To clarify this further I will ask a specific (but hypothetical) question: Say, I have identified the notes of a song, and they belong to this set [c d e f# g a b]. Now I end up wondering if this song is in the key of c major (with f# as accidental) or in the key of g major (with f as accidental).

Any tips on how to zero in on the correct scale when faced with such a scenario?

  • 4
    Does this answer your question? When is a piece in A minor versus C major?
    – user45266
    Commented Mar 8, 2021 at 8:10
  • Thanks for pointing to it. I will have a look.
    – Alphonso
    Commented Mar 8, 2021 at 8:32
  • 3
    Thanks. my question is not no much about the broad question "how to find a key of a song'. It's slightly more specific - it's about finding which is the right key for a given set of notes the when accidentals are involved. So you have two potential candidates (both major scales - as in the given example) and finding which is the right one.
    – Alphonso
    Commented Mar 8, 2021 at 9:47
  • @PiedPiper This keeps being asked, because there's no short comprehensive answer that actually solves it for people, and/or if there is, people cannot find it because it doesn't automagically pop up when posting a question. Several questions are marked as "accepted", but I doubt if those posters really learned how to identify where home is. Commented Mar 8, 2021 at 9:48
  • 1
    I wonder how you'd handle pieces with all 12 notes in the chromatic scale in their melody, but not in equal proportions. For example, "You Will Know Our Names" from Xenoblade Chronicles is one such piece, and I don't believe it ever modulates.
    – Dekkadeci
    Commented Mar 8, 2021 at 16:01

6 Answers 6


The most important thing to know is where home base is, the tonic chord. Is C major chord your home, or is G major your home. The home chord feels like a peaceful resting place where the song could end. All other chords and notes are experienced in relation to the tonic. If you don't know where home is, you're lost. Finding the tonic is your highest priority. Once you know that, then you have a perspective for looking at all the other notes around it.

Say, I have identified the notes of a song, and they belong to this set [c d e f# g a b]. Now I end up wondering if this song is in the key of c major (with f# as accidental) or in the key of g major (with f as accidental).

If you don't immediately feel what chord is home, the set of notes you found gives you candidates to try. The list of notes looks like the G major scale, so as a first guess you might try playing G major or E minor chords. E minor (the key) is G major's relative minor key and it has the same key signature of one sharp (F#). And you added C major as one more candidate. Let's see which one is the key:

How to try out candidate keys

Let's say we have three candidate keys: (1) G major, (2) C major, and (3) E minor. We test these hypotheses by playing "cadences" establishing different keys.

  • Is it in G major? Play a cadence for G major. Play the chords G - D - G. This should set G major as home base. Does that feel like the same home base as the song in question has, or different?

  • Is it in C major? Play a cadence for C major, play chords C - G - C. Same home or different?

  • Is it in E minor? Play a cadence for E minor, play chords Em - B - Em. Same home or different?

Intervals around the tonic CAN change, accidentals can change. If your song is in G, it can occasionally have an F chord even though F is not in the G major scale. Then you just think that at least during the F chord, F# is changed to F natural. Or you might have G - C - Cm - G, even though Cm is not "in the scale". So, find your tonic and look at all other notes from there.

A set of notes can give you some clues and tonic candidates to try, but even then you ultimately have to hear and feel which of the candidates is actually the tonic. You can't calculate the tonic, you have to feel it.

The Simpsons theme melody would be something like: C E F# A G E C A F# G, with C major as a home chord. Someone might say it sounds like the C Lydian mode. But the prominent use of the F# note doesn't move the home anywhere, it just gives a special feeling. But I would write it with a key signature of no sharps, and with accidentals on every F# note.

Any tips on how to zero in on the correct scale when faced with such a scenario?

Your goal is to find the home chord, more than it is to find a scale. The scale can change along the way, there can be temporary accidentals, and a part of the song can be in a different key i.e. with different home bases.

  • 1
    @Alphonso Were you able to use the method I presented here to decide what the most suitable key is for the song? Testing key hypotheses by playing I - V - I cadences. Commented Mar 9, 2021 at 7:15
  • “Home base” is a great way of explaining this, nice answer. Commented Mar 9, 2021 at 15:15
  • @JohnBelzaguy I think finding and feeling the musical center of balance should be taught as a first priority. Where is the center of balance - can you feel when you're falling over, or do you need measurements and Newtonian physics formulas to calculate it? You need to have a sense of balance to be able to even walk around, not to mention dancing. But here we have balette schools who teach balancing as logical rule sets instead of a skill. And the dancers are having trouble with it! Feeling the tonic is an essential practical skill and a sense that's needed to be able to operate in music, IMO. Commented Mar 9, 2021 at 17:43
  • I agree, I was going in that direction with my answer by saying “important chord” and “focal point” referring to the harmony but you really put it together. Commented Mar 9, 2021 at 18:10

Aside from @Tim’s good advice I also suggest learning the fundamentals of harmony and learning to recognize chords and simple chord progressions like 1-4-5, 1-6-2-5, 1-6-4-5, etc. This will often give you even better clues as to what the key the song is in. Using your hypothetical example, If the song starts and/or ends on a G chord or if G seems to be an important chord in the song then you are probably in that key. If E minor seems to be a focal point you might be in that key (E minor is a key that shares the same notes as G, it is the “relative minor” of G).

  • 1
    +1 for recognising chords and their relationships with each other. This may be too advanced right now for OP, but is essential in discovering a key.
    – Tim
    Commented Mar 8, 2021 at 8:54
  • How dare you not mention 1-5-6-4! :-) youtube.com/watch?v=oOlDewpCfZQ
    – Kevin
    Commented Mar 9, 2021 at 14:56
  • 1
    @Kevin Aw, come on, that one is only in 9,564,023 songs! Commented Mar 9, 2021 at 15:12

A lot of songs use only the notes diatonic to one key. That means all their notes belong to that key - usually.

By learning what the key signatures are for each key, you'll be 95% of the way there. For example, your sample of C D E F♯ G A B would tend to put that into key G, which has one sharp. If that song also centred around G, (i.e. G has the feeling of home), then it would most likely be in key G.

Those two factors are usually enough to establish the key.


I think you need to focus on finding the tonic.

Say, I have identified the notes of a song, and they belong to this set [c d e f# g a b]

That does not tell us the tonic so it's getting ahead of things to try identifying key/mode from just a set of pitches.

When finding the tonic you might go by the pitches of the melody, but also consider finding the tonic chord. You might encounter a melody built around the third or fifth scale degree in which case the tonic will be somewhere in the accompaniment.

When we know the tonic the set c d e f# g a b will actually then tell us the mode. Let's say the tonic is G. The set of tones tells us the mode is major. If C were the tonic, lydian is the modes, etc. etc.

Also, the melody might not contain all tones for a complete key signature so don't just look at the melody only, look at the accompaniment, and consider the possibility of choosing a key with less than a full key signature. You might have something like a melody based on a G pentatonic line G A B D E and accompaniment with G major and D major chords. That would leave you with no C, no fourth scale degree. You might say it is impossible to determine whether it's G major or G lydian. It's probably best to go with what is most common and say it's in G major. I wouldn't call it lydian without a conspicuous C#.

Now I end up wondering if this song is in the key of c major (with f# as accidental) or in the key of g major (with f as accidental).

So, the first option would be C lydian, and the second would be G major. Technically you don't have an accidental in either case, because F# is part of the key signatures. A case of a true accidental would be something like C major with most F's being natural, then an "accidental" F# moving up to G. In a nutshell, a progression like this C F C C | D D G G | G G G7 G7 | C C C C.

That kind of example is trickier, because of the chromaticism with F natural and F#, but the important point is still about determining the tonic is C, then determining the mode and what is an accidental versus tones of the key/mode.

When deciding about chromatic tones like F natural and F# in the example above the traditional method is to look at phrase endings, cadences, rather than how often either of the tones occurs. The music could have a lot of F# to G in the phrase, but if it ends G7 C where the F natural is used to move to an ending on the C chord, we consider the phrase ending the definitive thing and say F natural is in the key signature and all the F#'s were accidental, chromatic tones.

Find the tonic, either in the melody or accompaniment, then determine the key/mode. Traditionally phrase endings determine key.


Most songs end on the root note of the tonic. (Home chord).

  • If this final note is G your song is surely in G and F# is not an accidental it has to be set as key signature. For controlling we check the first note: If it’s a G or a tone of the G major triad you can be certain that we are in G-major and F# is the leading tone.

  • If the final note is E and you find additional accidentals like D# or C# the melody is in the relative key e-minor with the altered 7th D# = leading tone.

  • If the final tone is C and the first note is part of the C major triad the song is C and F# is an accidental, many songs are “modulating” at the end of the second phrase to a half cadence (dominant = G chord, of which the chord D,F#,A is a secondary dominant. This explains why we often encounter the note F# in a melody that’s in C major.

You can apply this rule to all other keys. For further information you must study the themes circle of fifths, secondary dominants, and half cadence.

If you play the chords with the l.h. the final chord of the harmony also will confirm in which the key you are.


enter image description here

This is C major, even though we have Bb and F#! No additional explanation needed.


If the song is in a diatonic, Western scale, then in that bunch of noes there are two similar tetrachords based on a tone-tone-semitone leap. One tetrachord is do-re-mi-fa, and the other so-la-ti-do. They are congruent, but they fit together in only one way, because they share the do, which starts one and ends the other. Find the so-la-ti-do tetrachord by ear, and the do is your root note. If that's F, the key signature is F major and so on.

Secondly, the piano has scale patterns. Once you know the patterns, you will instantly know just from the layout of the notes under the hand which key that is.

Thirdly, once you develop and ear for modes you will know instantly which mode it is when you play a run of seven notes starting on any note, and you will know where the tonic is. For instance, you will know that if you're hearing a Dorian scale, you started on what is the second degree of the relative major, so the root is the note before that one. Each mode has its own unmistakable melody and mood.

Now I end up wondering if this song is in the key of c major (with f# as accidental) or in the key of g major (with f as accidental).

For that you have to review the whole song. Is that F# just something short-lived in one spot in the song, or is it persistent?

Momentarily modulating to dominant degree key (e.g. C to G) is a common device. You know it when you hear it.

By the way, that could happen without the F# in the melody, or main melody. Rudolph the Red Nosed Reindeer has such a shift without that accidental being featured in the melody at the line: Rudolph, with your nose so bright ....

A song based on c d e f# g a b throughout could also be in the C Lydian scale throughout.

You have to look at which notes it is emphasizing: what is used as the starting and ending note for major phrases of the music. In other words which compositional pattern/practice does it fall into.

For instance, if there is a C-F-G7-C chord progression throughout much of the song, and the F# only appears in some chorus where a D chord is used, it's almost certainly key of C, with a modulation into G.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.