Device test · Audio

Pitch Detector

Play or sing a note and this page reports the strongest periodic component it can find in the sound reaching your microphone: the note name, how many cents sharp or flat it sits against A4 = 440 Hz, the frequency in hertz, and a clarity figure saying how periodic the signal actually was. It refuses rather than guesses — silence, sound with no steady period, and anything landing outside 60–1600 Hz each get a refusal that says which measurement failed. Audio stays on this device and nothing is uploaded.

Need something to tune against? This page listens and plays no sound; when you want a reference tone, that is the Tone Generator's job — it states its level and duration and carries the hearing-safety copy that belongs with them.

Inputnot requested Note Cents Frequency Clarity Level

Idle. Press start, allow the microphone, then play or sing one steady note — the readout fills in once five consecutive measurement windows agree with each other.

Processing state is reported once the microphone is open.

Sample rate is reported once the microphone is open.

Level is RMS in dBFS — relative to digital full scale, not loudness. A browser has no calibrated reference, so nothing here is a sound pressure measurement, and clarity is a periodicity statistic rather than a mark for how the note sounds.

How this test works

When you press start, the browser asks for microphone access and hands this page a live audio stream. The stream feeds one Web Audio analyser, and on every animation frame the page reads the most recent 2,048-sample window and derives two things from that single window: the RMS level in dBFS, which is what the silence gate tests, and a dominant fundamental estimate — the note name, the cents offset, the frequency in hertz and the clarity figure that backs them. Both readings come from the same samples, so the level you can see and the note derived from it are two views of one measurement rather than two measurements free to disagree. Unprocessed audio is requested for every capture, because noise suppression is built to remove the steady tones it reads as background and a held fundamental is exactly that; the line under the controls reports what the browser says it actually applied, which is not always what was asked for.

The estimator is a cumulative-mean normalized difference function, from the YIN family. For each candidate lag inside the band, the first 1,024 samples of the window are subtracted from the same window shifted by that lag, squared and summed; dividing each result by the running mean of every shorter lag turns a raw difference into a periodicity score that does not simply drift as the lag grows. The page takes the shortest lag whose score falls below 0.20 and follows it down to its local minimum — taking the deepest dip instead is the classic octave error, because the octave below a note is periodic too. That rule has a mirror image and the page guards that as well: when a harmonic runs well clear of the fundamental, no lag at the true period ever scores low enough, the first one that does is a fraction of the period, and the note would print an octave or more too high with its cents figure sitting near zero — a wrong note name wearing a perfect tuning. So before interpolating, the page checks whether three times or twice the chosen lag scores substantially deeper and takes the longer period when it does. Depth is what separates the two cases: a signal that really is periodic at the chosen lag scores about four times worse at double it, because the cumulative-mean normalization grows with the lag, while a signal whose real period is the longer one scores an order of magnitude better there. It then fits a parabola through the neighbouring lags for a sub-sample period, which matters most at the top of the band, where a period is about 28 samples and one whole sample of error is worth roughly 63 cents. Clarity is one minus that score, so the 0.80 floor quoted here and the threshold in the code are the same number. The frequency becomes a note by the standard mapping — A4 = 440 Hz, 12-tone equal temperament, sharps only, since D♯ and E♭ are one key and one frequency — and nothing reaches the readout until 5 consecutive windows have agreed within 50 cents, so a scrape, a door or the onset of a word never flashes a note the page cannot stand behind.

The limits are worth stating plainly. The failure class of this whole detector family is the octave error, and the band edges show it. Above the ceiling the page does not refuse, because a 1,900 Hz whistle has a period too short to search but twice that period is inside the band and cancels just as well, so it reads about an octave down. Further up it gets worse rather than staying at an octave: the fold lands on whichever whole-number division of the period first fits the band, so a 4 kHz whistle reads a third of itself at full clarity, and the octave-below reading holds over only part of the range above the ceiling. Below the floor the estimate is refused outright, and the floor itself is set by the analysis window, so at studio sample rates it rises and the page says by how much. Two sounds at similar strength are measured as the mixture they are, and a mixture repeats at a period neither sound has on its own. Everything before the arithmetic matters more than the arithmetic: a microphone's frequency response is not flat, browsers apply processing that this page can request off but cannot switch off, and a room adds reflections and noise of its own. And nothing here is a verdict. There is no score, no dB SPL, and no statement about whether an instrument is correctly tuned — the page reports where a note sits against one stated reference, and the judgment stays with you.

Frequently asked questions

How accurate is the note and the cents figure?
Accurate enough to tune by, and an estimate rather than a verdict. On a clean synthesized tone at an ordinary sound-card rate the frequency lands well under a cent right across the band, and the test suite holds it there at two of those rates. That figure belongs to the sample rate rather than to the page: the error at the top of the band is lag quantization, so it grows as the rate falls, and a hands-free Bluetooth headset — which drops the whole audio stack to 8 or 16 kHz — is worth tens of cents up at G6 rather than a fraction of one. The graph rate the page is actually running at is printed under the controls. Clarity is the other number to read, because it is the statistic backing the estimate: one sitting just above the 0.80 floor can be a semitone out or worse, so treat a clarity near the floor as a reason to play the note again rather than as a measurement to act on. On a real instrument in a real room the error is dominated by everything that happens before the arithmetic: the microphone's own frequency response, whatever processing the browser applies, reflections, and how steady the note itself is while it decays. Read the cents figure with a couple of cents of slack, watch which way it moves as you turn a peg or a slide, and remember what it is reporting — the strongest periodic component in the sound reaching the microphone, not an opinion about your instrument.
Why does it say “no steady pitch”, or nothing at all?
There are three refusals and each one names the measurement that failed. Below the −60 dBFS silence floor there is no signal to estimate at all. When nothing in the band is periodic enough — clarity below 0.80 — it reports no steady pitch, which is what breath, key clicks, traffic and a note that has already died away all produce. And an estimate that lands outside 60–1600 Hz is refused rather than reported at the edge — as is a note whose period is simply too long for the analysis window to hold, which is how a bass low E at 41.2 Hz is answered, and how everything under the raised floor is answered on a device that lifts it. The two refusals blur in exactly one place: a rumble so far below the floor that no part of a period fits the window leaves the arithmetic nothing in range to turn over on, and that reports no steady pitch. Two sounds at similar strength are the interesting case: the page measures the periodicity the mixture actually has, and two notes a third apart repeat at a much longer period than either of them, so the reading is a much lower note than anything being played; a mixture with no shared period at all falls through to the no-steady-pitch refusal. One clearly dominant sound is measured normally, though a second at a fifth of its amplitude still pulls the reading by around ten cents. One sound at a time is the honest way to use this.
Why 60 to 1600 Hz, and what falls outside it?
The band covers every string of a standard guitar (low E at 82.4 Hz), a five-string bass or baritone guitar's low B at 61.7 Hz, cello C at 65.4 Hz, viola, violin from G3 to E5, ukulele, and voice fundamentals from a low bass around 80 Hz to a soprano past 1,000 Hz — up to G6 at 1,568 Hz. The floor is where the mathematics stops standing behind the claim: at 44.1 kHz a 60 Hz period is 735 samples against a 1,024-sample comparison window, the last point where the window still holds a full period with margin. Because that floor is the window's rather than the band's, it moves with the sample rate: past a graph rate of about 61 kHz — a USB interface, an external DAC, a device set to studio quality — the window cannot hold a 60 Hz period at all, the floor rises with the rate, and the page prints the floor for that session under the controls and refuses below it rather than quietly searching a narrower band than the one it advertises. The ceiling is where lag quantization and harmonic ambiguity overtake the cents figure even with interpolation, and a tone within a hair of 1,600 Hz can interpolate a shade past it and be refused; the top note claimed here is G6 at 1,568 Hz, which reads dead on. What is excluded is excluded out loud rather than failed silently: a bass guitar's or double bass's low E at 41.2 Hz and the piano's bottom octave sit below the floor and are refused. Above the ceiling there is no refusal to fall back on, and the reading is not reliably the octave below — a flute or a whistle up there lands on some whole-number division of what was played. Swept cleanly from the ceiling to 5 kHz, about two readings in five are half the frequency played, two in five are a third of it (an octave and a fifth down), and roughly one in seven refuses. A 4 kHz whistle reads E6 at full clarity.
Can it play a reference tone to tune against?
No, and that is deliberate: this page listens and plays no sound. Playing a tone means owning the hearing-safety obligations that come with it — a stated level, a stated duration, and a warning next to the control — and the Tone Generator already carries all three and does that job properly. Open it in a second tab if you want something to tune against, play A4 at 440 Hz there, and read what your instrument is doing here.
What reference pitch and temperament does it use?
A4 = 440 Hz, and 12-tone equal temperament — the twelve equally spaced semitones a piano is tuned to. Both are choices rather than facts about music, so both are printed here instead of assumed. An orchestra tuning to A = 442 Hz reads about +8 cents at A on this page, and every other note with it; an ensemble at A = 415 Hz reads close to a semitone flat, which is exactly what it is. Just intonation, historical temperaments and the stretched octaves of a real piano all disagree with this grid by more than the numbers on the readout. The page reports where a note sits against one stated reference, and the judgment stays with you.

Related tests and guides