BPM (beats per minute) is the heartbeat of a track. Get it wrong by one beat and a remix doesn't lock; get it wrong by an octave and your DJ set falls apart. This detector uses onset-envelope autocorrelation with octave-error correction to read the tempo of any audio file in your browser. Drop a file, get a number — typically within ±2 BPM of ground truth on rhythmic material.
What BPM detection actually measures
BPM detection finds the periodicity in a signal's energy envelope. The classic approach: compute short-window RMS, take the half-wave-rectified differential to get an onset signal, then autocorrelate to find the most likely beat period. Edge cases include tempos that don't sit on integer-frame boundaries (174 BPM is famously tricky), songs with strong half-bar emphasis that fool the detector into reporting half-tempo, and songs with no clear rhythmic content. We mitigate the common octave-error case by checking whether the doubled tempo also has a strong autocorrelation peak — if so, we prefer the faster reading, since user-perceived tempo usually sits in the 100-180 BPM range.
How this detector works
Audio is decoded by Web Audio API and mixed to mono. We compute an RMS envelope at 100 Hz frame rate (10 ms hop, 20 ms window), then half-wave-rectify the first difference to isolate onsets. Autocorrelation runs over lags corresponding to 60-200 BPM. After picking the strongest peak, we apply post-hoc octave correction: if the half-lag (= doubled tempo) has a peak within 45 % of the chosen one, we switch to the faster reading. Parabolic interpolation around the chosen peak gives sub-frame BPM precision. Everything runs in browser TypeScript over Float32Array — no external libraries, no server.
When to use this tool
- Beatmatching for DJ sets and live performance
- Locking remixes and stems to a reference track's tempo
- Setting your DAW's project tempo before importing a recorded performance
- Vetting drum samples and loops to make sure they're labelled correctly
- Quick rhythm check on a song you can't immediately tap along to
Frequently asked questions
- How accurate is the detection?
- On rhythmically clear material (most pop, dance, hip-hop, rock with drums), expect ±2 BPM. On material with weak or absent percussion (orchestral, ambient, acoustic ballads) the algorithm has less to lock onto and may report half- or double-tempo. Confidence is reported alongside the BPM — a low confidence score means take the result with a grain of salt.
- Why does it sometimes report half my expected BPM?
- BPM detection is an inherently ambiguous problem when periodicity exists at multiple harmonically-related rates. We detect this case and prefer the faster reading, but for very slow songs (60-80 BPM) with strong subdivision, the detector may still pick the doubled tempo. Compare against your own tap-tempo reading if it doesn't feel right.
- Can it handle variable-tempo songs?
- Not well. The integrated reading reflects average tempo across the whole track. For songs with section-by-section tempo changes, a beat-tracking algorithm with per-frame output is the right tool — but that's much heavier and less suited to a free, browser-based utility.
- What if my track has no drums?
- Acoustic / ambient / non-percussive material is the hardest case. The onset envelope picks up tonal note attacks but they're much weaker than drum hits. Confidence will be low, and the result is unreliable. For these, you may want to enter the BPM by hand based on the composer's intent.
Privacy
Your file is analysed entirely in this browser tab — decoded by Web Audio API, processed by browser TypeScript, never uploaded. Closing the tab erases all working state.