Audio analysis · No upload

Find a song’s key on your device

Find a song’s musical key from its audio, with the runner-up key and the score margin beside it.

Key estimate

    
    

    

The strip shows the energy in each of the twelve pitch classes, scaled so the strongest reads 1.000; the values are not shares of the total energy. The ranking listed below it is worked out from this profile alone. When a result is close, compare the top two scores and the margin between them.

Statusidle Files— File— Duration— Sample rate— Analysed— Key— Runner-up— Margin— Network since file read—

One key per file, from a mono 11,025 Hz copy. None if the profile is nearly flat or the best correlation is below 0.5; noise, silence and speech can fail, while a tuned-kick drum loop can pass. Over ten minutes is refused by name. Under a 0.02 margin the Key row keeps the winner but the verdict is too close to call. Takes .wav, .wave, .mp3, .m4a, .aac, .ogg, .oga, .opus, .flac, .aif, .aiff and .weba.

How this key finder works

Your browser reads the file and decodes its audio. The page mixes the samples to one channel and walks the whole recording in short frames to build one pitch profile for the track; the Analysed row shows the duration and the number of frames. The browser decodes the full recording before its length is checked, and files longer than ten minutes are then refused by name.

The page runs 60 Goertzel filters, one for each equal-tempered note from C2 to B6 with A = 440 Hz: twelve pitch classes across five octaves. Each filter reads the Fourier bin nearest its note, so its frequency can sit slightly off the exact pitch. The readings fold into twelve pitch-class bins, scaled to the strongest, and that profile is correlated against twenty-four key profiles and ranked. The page shows the key, the runner-up and the gap between their correlations.

The tool assumes twelve-tone equal temperament, tests only major and minor keys and names one key for the whole file, so it does not follow key changes; Dorian or Mixolydian music comes out as one of the twenty-four keys or is refused. A small margin means the result is ambiguous, but a large margin, or passing the refusal checks, can still hide a key change or a recording with no single clear key. The flatness check rejects a profile above 0.97 on a scale where 1 is perfectly flat, and clips shorter than one frame, about 0.37 s, are refused. Pitched percussion can pass these checks, because to these energy measurements a kick tuned to a note is a note. The tool does not estimate tempo, chord progression, genre or time signature.

Frequently asked questions

Is my music uploaded anywhere?
No. The browser decodes the file, and this tab computes the pitch-class profile, the correlations and the ranking without downloading any analysis library. The meter counts resource-timing entries from the first file read, so the page’s own earlier loads are not included. Once the page has loaded, running an analysis offline is another way to check that the work happens on your device.
How does it decide on a key?
It finds the key whose standard profile best matches the notes in your recording. The page measures the energy at each note, folds it into one twelve-pitch-class profile for the whole track, and correlates that profile against 24 major and minor key profiles: the Krumhansl and Kessler probe-tone ratings from 1982, recorded in the served key.js source. The keys are then ranked by that correlation. The scores are correlations, not probabilities that a key is correct.
Why does it print a runner-up key?
So you can see how close the second choice came. The tool ranks all 24 keys, major and minor, and prints the runner-up with the score margin. A major key and its relative natural minor share seven pitch classes: C major and A natural minor both use the white keys, for example. Their note distributions and tonal emphasis can differ, so the profiles can sometimes tell them apart, but a short or ambiguous clip can rank them closely. When the runner-up is the relative key, the page labels it.
Why does it sometimes refuse to name a key?
Because one of its two checks failed. No key is named when the twelve pitch classes carry almost equal energy, so there is no tonal centre, or when no key profile correlates at 0.5 or better. Short, noisy or changing-key material can fail to form a useful profile. If the top two keys are less than 0.02 apart, the winner still stands in the Key row, but the verdict names both keys as too close to call.
Which audio formats work here?
WAV, MP3, FLAC, AIFF, M4A and AAC, OGG and Opus, and WebM audio, when your browser can decode the file’s codec. The page uses the browser’s own decoder and fetches no decoding library. Other extensions, and files the browser cannot decode, are refused. Video files are not accepted here, so extract the audio with a converter first.

Related tools