Tools

How to find the key of a song: by ear, from the chords, or with a key finder

How to find the key of a song: by ear, from the chords, or with a key finder

You want to know what key a song is in: to sing it, to play along, to write a part for it, or to mix it into the next track without the basslines fighting. There are three ways to find out, and each one is right in a different situation. You can find the home note by ear in a few minutes with nothing but a keyboard. You can read the key from the chords if you know them. Or you can let a key finder listen to the audio, which is fastest and, as this guide shows with real numbers, wrong about a third of the time in a predictable way. This guide covers what a key actually is, each of the three methods step by step, why detectors disagree and how to settle it, what to do when a song changes key or sits between two notes, and which free tools do the work.

A key is the note a song comes home to, plus a scale

Every key has two parts. The first is the tonic, the one note that sounds like home: the note a melody resolves to at the end of a chorus, and the one the bass keeps returning to. The second is the scale built on that note, which in most pop, rock, dance and hip hop is either major or minor. Twelve possible home notes times two scales gives the 24 keys, from C major to B minor.

Major and minor differ in three notes. Counting up from the tonic, a major scale has a bright third (four semitones up), a sixth and a seventh that sit high; the natural minor scale lowers all three. That lowered third is the one your ear catches first: a minor chord on the home note sounds darker because its middle note is a semitone lower.

A pianist's right hand playing the keys of a digital piano, seen from the side with the stage lights blurred behind.
Any keyboard is enough to find a key by ear: one note at a time until one sounds like home. Photo: Gabriel Barletta, CC0, via Wikimedia Commons.

Relative keys share every note

Here is the fact that explains most confusion about keys. Every major key has a relative minor that uses exactly the same seven notes. C major and A minor are both the white keys of a piano. G major and E minor both have one sharp, F sharp. The only difference is which note is home. The relative minor always starts three semitones below the major tonic, so you can find it by counting down three keys on a piano, black keys included.

Major keyRelative minorSharps or flats
C majorA minorNone
G majorE minor1 sharp (F♯)
D majorB minor2 sharps (F♯, C♯)
A majorF♯ minor3 sharps
E majorC♯ minor4 sharps
B majorG♯ minor5 sharps
F majorD minor1 flat (B♭)
B♭ majorG minor2 flats (B♭, E♭)
E♭ majorC minor3 flats
A♭ majorF minor4 flats
D♭ majorB♭ minor5 flats
F♯ major (G♭)D♯ minor (E♭)6 sharps or 6 flats

So when two people, or two apps, disagree about a song being in A minor or C major, they usually agree on the notes and disagree on home. That is a smaller disagreement than it looks, and the methods below settle it.

Find it by ear: hum the home note, then test major against minor

This is the method musicians use, and it works on anything you can hear, including songs you only know from the radio. You need a keyboard: a real one, a cheap one, or a free piano app on your phone.

  1. Play the song and wait for a resting point. The end of a chorus, the last note of a verse line, the moment the song feels finished before it starts again. Hum the note that sounds settled there, and keep humming it after you pause the song.
  2. Find that note on the keyboard. Press keys until one matches your hum. Octave does not matter: a C an octave up is still C. Most people land within a key or two on the first try and then walk up or down one semitone at a time until it locks.
  3. Check it against the bass. Play the song again and hold your note down. On the home note, it sounds calm under the whole chorus. If it rubs against the bass for long stretches, you have probably found the fifth (seven semitones above home), which is the second most stable note in a key. Try the note five semitones above or seven below yours.
  4. Decide major or minor. Play three notes together on your tonic: the tonic, four semitones up and seven semitones up (a major chord). Then move the middle note down one (a minor chord). Play each over the song. One of them fits; the other sounds sour against the song's third.
  5. Write it down both ways. If it was the minor chord on A, the song is in A minor, and its relative is C major. You will want both names later, because chord sites and DJ software often list the other one.

Five minutes is realistic for a first attempt, and it gets faster with practice. The hard part is step one: songs that never fully rest, such as a dance track that loops the same four bars, or a song that fades out instead of ending. For those, the chords are a better witness.

Read it from the chords: the first and last chord usually give it away

If you know the chords, from a chord sheet, a tab site or your own ears, the key is a short puzzle. Each key has seven chords built from its own notes. In a major key they are, in order, major, minor, minor, major, major, minor and diminished; in the Roman numerals musicians use, I, ii, iii, IV, V, vi and vii°. A song mostly uses chords from one set, and finding that set finds the key.

KeyIiiiiiIVVvi
C majorCDmEmFGAm
G majorGAmBmCDEm
D majorDEmF♯mGABm
A majorABmC♯mDEF♯m
E majorEF♯mG♯mABC♯m
F majorFGmAmB♭CDm

The progression C, G, Am, F lives entirely in the C major row. So does Am, F, C, G, because it is the same four chords in another order. This is the relative-key problem again, and the tiebreaker is where the progression starts and ends. Songs usually begin on home or return to it at the end of a section. If the loop starts and lands on Am, the song is in A minor; if it rests on C, it is in C major.

A lead sheet of the folk song Greensleeves: three lines of melody in treble clef with two flats in the key signature, and chord names above the staff such as Gm, F, D, B flat, Am and Dm.
Greensleeves as a lead sheet: two flats, and it starts and ends on Gm, with a D major chord pulling back home. That is G minor. Score: Redpaul1, CC BY-SA 4.0, via Wikimedia Commons.

Three clues that settle major against minor

  • A major chord a fifth above a minor home. In A minor, you will often see E or E7 instead of Em. That major V chord borrows a G sharp, the note that pulls hardest back to A. If a set of chords that looks like C major also has an E major in it, the song is in A minor.
  • The chord before the ending. The strongest move in tonal music is V to I: G to C, or E to Am. Whatever chord the V resolves to is home.
  • The bass under the chorus. The chorus is where songs state their key most plainly. If the bass sits on A through most of it, A is home even if the verse wanders.

You do not have to do this in your head. The free song key finder has a Chords mode: type the progression, such as Am F C G or Cm7 Fm7 B♭7, and it ranks the keys the chords fit, shows each chord as a Roman numeral in that key, and weighs the first and last chords most, the same way you would.

Let a key finder listen, and know what it is measuring

A key finder does, very quickly, a version of what your ear does. It never hears a home note directly. It measures how much of each of the twelve notes a recording contains, then asks which of the 24 key shapes that mixture resembles most.

  1. Notes from sound. The audio is cut into short slices, a fifth of a second each, and a frequency analysis finds the strongest peaks in each slice. Each peak is a pitch, and every pitch belongs to one of the twelve note names, whatever its octave.
  2. A profile of the song. Adding those up over the whole song gives twelve numbers: how much C, how much C sharp, and so on up to B. Musicians call this a chroma, and it looks like a bar chart with seven tall bars when the music stays in one key.
  3. A match against key shapes. Each key has a typical shape too: the tonic tallest, the fifth next, then the third, with the notes outside the scale low. The finder compares the song's chart with all 24 shapes and picks the closest.
The ImmerGround key finder after analysing a song: the readout says A minor, 8A in Camelot and 1m in Open Key, with 120 BPM and the tuning at A = 440 Hz; below it a coloured strip shows the key over time, a bar chart of the twelve notes heard with the A minor scale lit, and a CD player with a Reference chord switch.
Our free key finder after reading a song: the key with its Camelot and Open Key codes, the key over time, and the notes it heard

This is why key finders are fast and why they fail in the ways they do. The shapes for a key and its relative share all seven notes, so they differ only in which bars are tallest. The shapes for two keys a fifth apart share six of seven notes. Most wrong answers are therefore one of those neighbours, not a random key: A minor read as C major, or C major read as G major.

Our key finder, like every one worth using, shows its runner-up for exactly this reason, and it adds three things we found missing on other free tools. It reads the key section by section, so a song that changes key shows where. It measures the tuning, so a record that runs slightly fast still reads right. And it lets you drop a whole folder of songs and download the list as a spreadsheet. It runs in your browser, and nothing is uploaded.

Where the common advice breaks: the last chord is not always home

The rule every tutorial repeats is that the last chord of a song is the key. It is a good first guess and it fails often enough to be dangerous.

  • Fade-outs. A song that fades on a repeating chorus never plays a last chord at all. The final chord you hear is wherever the engineer pulled the fader down.
  • Endings on the IV. Plenty of rock and gospel ends on the chord a fourth above home, a sound called a plagal ending. Take the last chord literally and you are a fourth off.
  • Loops that never resolve. Much dance music, and a lot of modern pop, cycles four chords for the whole track. There is no ending chord, only a loop, and the loop's first chord may not be home either. Listen for the chord the drop or the chorus lands on after a build.
  • Modal songs. Some songs use the notes of one key but rest on a different one of them. The traditional sea shanty Drunken Sailor and the folk song Scarborough Fair are usually given as examples of the Dorian mode: minor-sounding, but with a raised sixth. A key finder can only answer major or minor, so it will name the closest of the two, and a chord sheet may name a third option. None of them is wrong; the song simply is not in a plain major or minor key.

The more reliable rule is the one from the ear method: home is the note the music rests on, and the chorus states it most clearly. Use the last chord as a clue, not a verdict.

Why key finders disagree, and how often they are wrong

Every automatic key finder makes mistakes, including the paid ones, and knowing the size of the error changes how you use them. The most widely cited comparison is a 2015 test by DJ TechTools: 66 tracks from Beatport, with the correct key agreed by a panel of listeners, then run through each program. Mixed In Key matched the panel on 86 percent of them, Serato and rekordbox on 70 percent, the free KeyFinder on 65 percent, Beatport's own key tags on 61 percent, Traktor on 47 percent and VirtualDJ on 41 percent. Every program has been updated since, so treat those numbers as a picture of how large the spread was, not as a current ranking. Our guide to Mixed In Key alternatives compares what each option costs and does today.

We measured our own finder the same way, and publish the method so you can judge it. On 146 recordings with a known key, 77 classical pieces from Wikimedia Commons and 69 electronic tracks, pop recordings and loops from Freesound and Jamendo, it named the exact key on 66 percent and the key or a close neighbour on 93 percent. Three in four of the misses were a fifth away or the relative key, the two errors the method is prone to. It was more accurate on the classical set, where the harmony is clear, than on the loops, many of which sit on one or two chords for their whole length.

What the finder saysWhat it usually meansWhat to do
A key, reading ClearThe winner beat every other key by a wide marginTrust it, then check the relative key by ear
A key, reading Fair or UnsureTwo keys scored close, usually a fifth apartTreat the runner-up as equally likely and listen
Relative key shown beside itThe same notes, a different homeHum the home note; it decides
No clear keyMostly drums, speech or noiseTry a section with chords, or type the chords

The practical lesson: an automatic key is a strong suggestion that narrows 24 options to two or three. Your ear, or the chords, picks among those.

When the key changes halfway: modulations

A song that changes key is said to modulate, and pop songs do it more than you might think. The classic move is the lift before the last chorus: the whole band jumps up a semitone or a whole tone and repeats the chorus higher, a trick so common in ballads that people nicknamed it the truck driver's gear change. Film music, musicals, jazz standards and progressive dance tracks modulate in less obvious ways, sometimes several times.

A modulation breaks every method above in a specific way. By ear, the home note you hummed in the verse stops fitting in the last chorus. From the chords, the song seems to use chords from two keys. And a key finder that only reports one answer for the whole song averages the two keys together, which can land on a third key the song never plays: a song that moves from C major to D major can average out near G major, the key halfway between them on the circle of fifths.

The key finder on a song that changes key: the headline says C major with the reading Fair, and the key-over-time strip splits into 8B C major for the first half and 10B D major for the second, with the playhead in the second section.
A song that moves up a whole tone halfway: the strip shows C major, then D major

That is why our finder draws the key section by section. It scores the song in overlapping windows of 16 seconds and draws a coloured strip where each colour is a key, with the Camelot code on each section. A real modulation shows as a clean change of colour that stays changed. A borrowed chord or a busy bridge does not, because the strip only changes when the new key holds for long enough to be real. If the whole-song answer is a key that none of the sections are in, it reports the key of the longest section instead. For the kinds of key change songs use, from the last-chorus lift to the classical move to the relative major, see our guide to key changes in songs.

Tuning: when a song sits between two keys

Almost all modern music is tuned so that the A above middle C vibrates at 440 times a second. Not all recordings keep to it. A turntable running one percent fast raises the pitch by about 17 cents, a sixth of a semitone. Tape machines, old records and some bands tune slightly off. Tracks tuned to 432 Hz, a popular choice in some genres, sit about 32 cents flat, a third of the way to the next key down.

A metal tuning fork lying across printed sheet music, the page slightly out of focus.
A tuning fork gives one fixed pitch, usually A at 440 Hz; recordings do not always match it. Photo: Lukasz Kobus, European Commission, CC BY 4.0, via Wikimedia Commons.

Small offsets do not change the key, but they make a naive detector wobble, because the notes land between the slots it expects. Our finder measures the offset first, reports it in cents, and corrects for it when it is large enough to matter.

One case fools every method, and it is worth knowing if you work with classical recordings. Many baroque performances on period instruments tune A to 415 Hz, almost exactly a semitone below modern pitch. A piece written in D major and played at 415 sounds, to your ear and to any key finder, like D flat major. Nothing is wrong with the recording or the finder: the written key and the sounding key differ by a semitone. For mixing or playing along, the sounding key is the one that matters.

Where to get it: free tools for key and tempo

  • Song key finder. Free, in your browser, no account. Drop a song or a folder of them, listen through the mic, or type the chords; you get the key, Camelot and Open Key codes, the key over time, the tuning and the tempo, and nothing is uploaded.
  • BPM finder. Free, in your browser. Tap along, drop a song or use the mic for the tempo to a hundredth of a BPM, with a click on every beat so you can check it by ear. Our guide to finding the BPM of a song covers every other way to get the tempo.
  • Live audio visualizer. Free, in your browser. Your mic or a song drives effects on a clip, a photo or a scene drawn in code, and you can record the result as a video.
  • ImmerGround for iPhone, iPad and Mac. Our app, free to download, with ImmerGround Pro at $6.99 a week or $39.99 a year. It does not name keys; it listens to the bass, mids, highs and every beat, and moves your own clips and photos with them live.

If the key is for a DJ set, the next question is which keys mix with it, and that is what the Camelot wheel answers. Our guide to the Camelot wheel covers every move, and our guide to visuals for DJ sets covers the screen behind you.

What to do next

  1. Run the song through a key finder first. It takes seconds, and it narrows 24 keys to the answer and its runner-up.
  2. Look at the relative key it shows, and hum the home note. This one step fixes most wrong answers, because most wrong answers are the relative key.
  3. If the reading is Fair or Unsure, check the chords. Type them into Chords mode or find them on a chord sheet, and see which key the first and last chords point to.
  4. Look at the key over time. If the strip changes colour and stays changed, the song modulates, and each section has its own answer.
  5. Write down the key, its relative, its Camelot code and the tempo. Together they tell you what you can play along in, what you can mix it with, and how fast.

Free tools and the app

Keep reading