Key & Scale Detector

Detect the tonal content of any audio file for free. Detects key, scale, and displays a chromagram of tones detected in the audio.

Upload Audio File
Drag and drop an audio file or click to browse. Supports MP3, WAV, FLAC, and other common formats.
🎵

Click or drag to upload

What is audio key detection?

Audio key detection is the process of analyzing a piece of music or a single sample to determine its musical key — the tonal center around which the notes are organized. Every melodic sample in Western music gravitates around one of twelve pitch classes (C, C#, D, D#, E, F, F#, G, G#, A, A#, B), combined with a scale (most commonly major or minor). Knowing the key of a sample tells you how it will interact with other elements in your track and which chords, melodies, and basslines will sound in tune with it.

For producers working with sample libraries, knowing the key of every loop, one-shot, vocal chop, and pad is the difference between effortless layering and hours of trial and error. A loop tagged with the wrong key — or with no key at all — can pull your whole track out of tune. This free Key & Scale Detector runs entirely in your browser and gives you an answer in seconds, with no upload, no sign-up, and no credit-card dance.

How the detector works

Under the hood, the tool extracts a chromagram — a twelve-bin representation of how much energy your audio has at each pitch class across its entire duration. We use Meyda, an open-source Web Audio feature extractor, to compute the chroma vector of your file in overlapping 8192-sample Hanning-windowed chunks. Averaging those chunks gives a stable fingerprint of the tonal content of the sample.

Once we have a chroma vector, we compare it against the Temperley key profiles — weighted templates for each major and minor key that reflect how strongly each pitch typically appears in that key. We rotate the chroma through all twelve possible tonics and compute a Pearson correlation against both the major and minor templates, giving us 24 candidate scores. The highest-scoring candidate is the detected key; the next two scores are shown as runner-ups so you can sanity-check ambiguous samples.

When a file is too short, too noisy, or genuinely atonal (think percussion hits, white noise, or metallic FX), the detector will tell you so explicitly instead of guessing. If only a single pitch class dominates, you'll get a note-only result — useful for one-shot samples like a single bass hit or a vocal "ahh".

Supported file formats

The tool accepts any audio format your browser can decode via the Web Audio API. In practice that means MP3, WAV, FLAC, OGG, M4A, and AAC all work reliably. There's no file-size upload cap imposed by us — the file never leaves your machine — but very large files will be slower to decode in the browser. For best results, analyze samples up to about 5 minutes long.

How accurate is it?

Correlation-based key detection using Temperley profiles is a well-studied technique and works reliably on clean melodic and harmonic material: chord loops, melody lines, pads, piano phrases, and vocal samples. Expect strong results on anything that has a clear tonal center and lasts at least a couple of seconds.

The algorithm is less reliable on samples that contain relative modal ambiguity (e.g. a loop that could be heard as either C major or A minor), very short one-shots, heavily processed sound design, or pitched percussion. In those cases, trust your ears over any automated tool — and use the chromagram at the bottom of the results as a visual sanity check of what the detector is "seeing".

Your audio never leaves your computer

Detection happens entirely in your browser using the Web Audio API. Nothing is uploaded, nothing is stored, nothing is sent to a server. Close the tab and every byte of your sample is gone. This is useful if you're working with unreleased material, client stems, or label content you can't upload to a third-party service.

Example use cases

  • Layering two loops — quickly check whether a new loop will sit in the same key as the one already in your session.
  • Cataloguing an unlabeled pack — batch-check samples from a drive or ZIP that came without metadata.
  • Remix prep — confirm the key of an a cappella or stem before you start writing new harmony.
  • Songwriting — pitch a reference track through the tool to discover what key a song you like is actually in.
  • Sampling — find the root note of an obscure record clip before resampling it into a new context.

Need this for your whole library?

This page is a free companion to Sample Vault, our desktop app for music producers. Sample Vault runs the same kind of analysis on every sample in your library automatically, stores the results in a searchable index, and lets you find the right sound by describing it in natural language ("dark minor pad with reverb", "130 BPM punchy kick", "emotional piano in C#"). BPM, key, genre, mood, brightness, stereo width and more are all tagged for you on first scan — and the app is free to start.