Knowing a song’s key tells you which chords to play along with, which tracks blend smoothly in a DJ set and how far to transpose for a singer. Drop in a file to get its key, Camelot code and the notes behind the decision.
Processing locally on your device
Overview
Key detection is based on a chromagram, which folds a recording’s spectrum into the twelve pitch classes of Western music, C, C♯, D and so on, regardless of octave. The detector decodes your file, mixes it to mono and takes up to 1,500 FFTs of 8,192 samples spread across the track. Every frequency bin between 55 Hz and about 4.2 kHz is assigned to its nearest semitone with a triangular weighting, so bins that fall between two notes count less. This is a lightweight approximation of a constant-Q transform, and each frame is normalised so quiet passages contribute as much as loud ones.
The resulting twelve-value profile is compared with the Krumhansl–Schmuckler key profiles, which come from listening experiments that measured how well each note “fits” in each major and minor key. The tool rotates the major and minor profiles to all twelve tonics, calculates the correlation with your chroma for all 24 keys, and ranks them. The best match is the detected key; the next two are shown as alternatives with their correlation values, and the confidence combines how good the best fit is with how far ahead of the runner-up it is.
Relative keys are the most common source of doubt. C major and A minor share the same seven notes, so their chromagrams look almost identical, and the decision rests on which notes are emphasised, especially the tonic and fifth. Songs that modulate, use modes such as Dorian or Mixolydian, or loop an ambiguous chord progression can also produce lower confidence. Selecting just one section of the waveform, such as a chorus or the part after a key change, often gives a clearer answer, and the Hear tonic chord button lets you check the result by ear.
DJs often use the Camelot wheel, which numbers keys 1 to 12 with A for minor and B for major. Keys with the same number, or numbers one step apart with the same letter, mix harmonically: 8A (A minor) blends with 8B (C major), 7A (D minor) and 9A (E minor). The detector shows both the Camelot code and the equivalent Open Key code, plus the three closest harmonic neighbours.
| Camelot | Minor (A) | Major (B) |
|---|---|---|
| 1 | A♭ minor (G♯m) | B major |
| 2 | E♭ minor | F♯ major |
| 3 | B♭ minor | D♭ major |
| 4 | F minor | A♭ major |
| 5 | C minor | E♭ major |
| 6 | G minor | B♭ major |
| 7 | D minor | F major |
| 8 | A minor | C major |
Drop a song or audio file onto the page; the whole track is analysed automatically.
Read the key, its Camelot and Open Key codes, the relative key and the confidence.
Check the chroma chart and the top three candidates if the confidence is low.
Drag across the waveform to analyse one section, such as the chorus or a part after a key change.
Press Hear tonic chord to compare the detected key with the music by ear.
Use cases
Sort a crate by Camelot code so transitions between tracks stay in compatible keys, avoiding the clash you hear when two basslines fight each other.
Find the key before learning a cover, then transpose or capo to suit your voice. The chroma chart shows which notes appear most, a useful hint for picking chords.
Check the key of a sample, loop or acapella before building a track around it, so new parts are written in the right scale from the start.
Show students how a melody’s note distribution points to a key, and why relative major and minor keys are easy to confuse.
Pro tips
Answers to common questions about the key detector.
The Camelot wheel numbers the 24 keys from 1 to 12, with A for minor keys and B for major keys, arranged so neighbouring numbers are a fifth apart. Tracks with the same code, the same number with the other letter, or a number one step away mix smoothly. For example, 8A is A minor and 8B is C major.
A major key and its relative minor use exactly the same notes, so their pitch profiles differ only in which notes are emphasised. If the music leans on the sixth degree of the scale, a major-key song can score slightly higher as its relative minor. The relative key is always shown next to the result.
It reports the best-matching major or minor key for the analysed audio. Modal music is matched to the closest major or minor key. For key changes, select each section separately to get a key for each part.
On pop, rock and electronic music with clear harmony, profile-based detection usually finds the right key or its relative. It is less reliable on atonal, heavily percussive or modal material, which is why the confidence score and alternatives are shown.
No. The file is decoded and analysed by JavaScript in your browser tab. A four-minute song takes about a second on a typical laptop.
Yes. The key detector is free to use with no sign-up, no watermarks and no daily limits.