Pro Pro is active in this browser. Open your Pro accountPro free trial is active. Open your Pro accountPro is active but will not renew. Open your Pro account

BPM Detector: Tempo and Key Finder for Audio Files

Drop a song, loop or sample into this BPM detector to get its tempo to one decimal, its key and Camelot code, worked out on your own device.

Free · runs in your browser · nothing is uploaded

Open on Tonelume

This embed was switched off for this website. Open on Tonelume

Add this tool to your siteFree embed code, no sign-up. Keep the credit link.

Embed this tool

Copy this code into your website, blog or class page. The tool runs inside your page.

Optional settings, added to the address after embed=1: &accent=0f6b5c (colour, 3 or 6 hex digits). Other parameters are ignored.

Please keep the credit link below the tool.

This BPM detector finds the tempo in BPM and the musical key of an audio file. It reports the tempo to one decimal place with the rounded whole number and a tempo name such as Allegro, and names the key with its Camelot code and relative key. Choose a file or drop one on the page: the analysis runs on your own device, nothing is uploaded and no account is needed. Use it as a bpm finder for MP3 files you already have, or as a quick bpm and key finder before you sort a playlist. A waveform with every detected beat lets you hear whether the answer fits.

How to find the BPM and key of an audio file

  1. Drop an audio file on the box marked “Drop an audio file here”, or press Choose a file. MP3, WAV, M4A, OGG and FLAC work when your browser can decode them. The file needs at least 4 seconds of audio.
  2. Watch the progress bar. A typical song takes a few seconds; longer files take longer, and only the first 15 minutes of a longer file are analysed.
  3. Read the tempo card: the BPM with one decimal, “rounded: N BPM” under it and the tempo name, such as Andante or Allegro. Send to metronome opens the metronome at that tempo (Tonelume Pro).
  4. Check the confidence line. If it is not high, press ÷ 2 or × 2, or look at the chips under “Other tempos it could be”, which list up to three other likely tempos.
  5. Read the key card: the key with major or minor, the Camelot code and the line “Same notes as …, its relative key”. An “Also possible” line names the runner-up key when the key confidence is not high. Drums-only files show a “No key” message instead.
  6. In Waveform and beats, press Play to hear the file with a click on each detected beat, and Stop to end it. The taller ticks mark the first beat of each bar. The free version marks the first 8 bars.

How does the BPM detector find the tempo?

Two detectors run on the same audio and their answers are matched by octave. The first is the open-source realtime-bpm-analyzer library, which measures how the energy rises in several frequency bands and finds the spacing that repeats (autocorrelation), giving ranked tempo candidates. The second is Tonelume’s own onset detector built on the Meyda audio library, the same engine as the microphone listener of the BPM finder; it gives a decimal tempo.

The tempo is then fine-tuned and a beat grid is laid over the file, with each beat moved to the strongest hit within 45 milliseconds, so a slowly drifting live tempo is followed. The first answer always falls between 60 and 160 BPM, the same range the BPM finder uses, so both pages agree.

How does it find the key?

The page adds up how much of each of the 12 pitch classes, C to B, sounds across the whole file. It compares that chroma profile with the typical profiles of all 24 major and minor keys (the Albrecht-Shanahan key profiles) and picks the closest match. The gap to the second-best match sets the confidence: high, medium or low.

For a song in C major the key card adds “Same notes as A minor (8A), its relative key.” When the confidence is not high, the runner-up is shown as “Also possible”, because in testing the runner-up was often the right answer when the two were close.

Example: a 124 BPM drum loop

This is the page’s real output for a generated 30-second drum loop at 124 BPM. The tempo card reads 124.0 BPM, rounded 124, with half time 62 and double time 248, tempo name Allegro and high confidence. The other tempos shown are 99, 82.5 and 93. It found 62 beats and no key, because drums alone have no clear notes. The first beats of the beat map:

BeatBarBeat in barSecondsTime
1110.2110:00.211
2120.6990:00.699
3131.1780:01.178
4141.6670:01.667
5212.1460:02.146

The drums in that clip start at 0.21 s, so the first beat lands within 1 ms. The columns are the same as in the beat map CSV of Tonelume Pro.

How accurate is it?

On 50 labelled tracks the key was exactly right 84% of the time (42 of 50), and right or the relative key 88% of the time (44 of 50). The tempo was within 1 BPM on all 16 generated test files. The method was picked as the best of 9 combinations on this same set, so expect a few points lower on new songs: roughly 8 in 10.

TestResult
Key, exact, 50 labelled tracks84% (42 of 50)
Key, exact or relative key, 50 tracks88% (44 of 50)
Key, exact, the 26 real recordings only84.6% (22 of 26)
Tempo, 16 generated files (clicks 60-140 BPM, drum loops, swung grooves with noise)all within 1 BPM

The 26 real recordings are public-domain or Creative Commons pieces whose key is in the title; the other 24 are synthetic multi-instrument clips made for the test. On the clean click tracks the beats were placed within 20 milliseconds of the clicks. Music with rubato or no clear pulse has no single BPM, and the page says so instead of guessing.

What is the Camelot code?

The Camelot code is a number from 1 to 12 followed by a letter: A for a minor key, B for a major key. A key and its relative key share the number, and neighbouring numbers are a fifth apart. DJs mix tracks whose codes are equal or next to each other, which is why a bpm key finder shows it next to the tempo.

KeyCamelot
C major8B
A minor8A
G major9B
D♭ major3B
F♯ minor11A

Frequently asked questions

Is my audio sent to a server?

No. Your browser decodes the file and a background worker analyses it on your own device. Nothing is uploaded, nothing is stored on a server and no account is needed. When you leave the page, the file and its result are gone unless you saved the CSV yourself.

Which audio formats are supported?

MP3, WAV, M4A, OGG and FLAC work when your browser can decode them, which covers most music files. If a browser cannot read a file, the page says so and suggests trying an MP3 or WAV copy. To find the BPM of an MP3, drop it on the page or press Choose a file.

Why is the detected BPM half or double the expected value?

The first answer is always placed between 60 and 160 BPM, so a very fast or very slow song can start an octave away from the count you feel. A 174 BPM click track first reads 87 BPM, and × 2 gives 174. Press ÷ 2 or × 2 to switch.

Why does the analysis take a few seconds?

The whole file is decoded first, then scanned twice for beats and once for pitch, so a typical song takes a few seconds and a long one takes longer. The progress bar shows how far it has got. Files longer than 15 minutes are analysed over their first 15 minutes only.

No. This page reads audio files only; it does not listen to the microphone or open YouTube and streaming links. To tap along or let the microphone listen, use the BPM finder. For the tempo and key of a file you have, drop it here.

Does it work on a phone?

The page runs in the phone’s browser like on a computer: press Choose a file and pick a song from the phone’s files. Decoding and analysis happen on the phone itself, so long files take longer there than on a desktop computer.

What if the song changes key?

The page reports one key per file: the key that sounds longest across the whole song. A song that moves between keys still gets only that one key. When the key confidence is not high, read the “Also possible” line on the key card as well: it names the runner-up key.

Is the BPM detector free?

Yes. One file at a time is free with no account, with the full answer: BPM, tempo name, half and double time, confidence, other tempos, key, Camelot code, relative key and the beat ticks of the first 8 bars. Tonelume Pro adds the batch list, the full beat map with its CSV and Send to metronome.

  • BPM finder: tap the beat or let the microphone listen to find the tempo live, with a delay time table.
  • Metronome: practise at the tempo you found, with accents and time signatures.
  • Rhythm trainer: check you can keep time at the tempo you found, with listen-and-clap drills.
  • Tonelume home: all Tonelume tools in one place.
  • Credits and licences: the open-source libraries used here, including realtime-bpm-analyzer, Meyda and the key profile code.
  • Privacy policy: what the site stores on your device and what it never sends.