About this guitar tuner

A small, dependency-free page for one job: telling you, in real time, how close a plucked string is to the note it should be — no app, no cable, no account.

Why it exists

A phone or laptop already has a microphone, and a browser tab is faster to reach for than installing a tuner app or digging out a clip-on unit. This page needs no install and no account: open it, click Start, pluck a string, and read the note, the frequency and how far off it is.

How the pitch detection is computed

Once getUserMedia returns a stream, it is connected to a Web Audio AnalyserNode with an FFT size of 4096 — large enough to hold several full cycles of even the lowest string this tool targets (D2, about 73Hz) at a typical 44100Hz or 48000Hz sample rate. Roughly once per animation frame, the tool reads that window of raw time-domain samples and runs a difference-based autocorrelation over it:

For each candidate lag (a number of samples), the tool measures how closely the waveform matches a copy of itself shifted by that lag. A perfectly periodic signal matches almost exactly at a lag equal to one full period (and at its multiples); the tool looks for the first strong match as that lag increases, rather than continuing on toward a taller match at a multiple of the true period, which would report a whole octave incorrectly. Parabolic interpolation across the three measurements nearest that peak then refines the estimate between whole-sample lags.

Sample rate divided by that refined lag gives a frequency in Hz. The frequency is converted to a note using standard equal temperament (A4 = 440Hz, MIDI note 69; every other note's frequency is 440 × 2^((n − 69) / 12) for MIDI note n), and the deviation from the nearest semitone is expressed in cents — 100ths of a semitone — which is what positions the needle. A buffer whose root-mean-square amplitude is too low to be a real signal is treated as silence rather than guessed at, and the readout applies light exponential smoothing so a single noisy frame doesn't visibly jerk the needle.

How the site is built

  • Static HTML, one small stylesheet, one small script. No framework, no build step, no bundler.
  • Nothing about your audio leaves your device. There is no recorder, no upload endpoint, and no analytics beacon on this page for it to reach even by accident.
  • System font stack. Your operating system's UI font, so nothing has to download and nothing shifts as the page loads.
  • Dark mode follows your system setting via prefers-color-scheme.
  • The microphone is released deterministically. Clicking Stop stops every audio track and closes the AudioContext; the same happens automatically if you navigate away or close the tab.

Scope and honesty about limits

This is a genuinely useful tuner for practising at a desk, not a replacement for a calibrated clip-on or pedal tuner. A hardware tuner reads the instrument's own physical vibration and is largely unaffected by background sound; a microphone cannot be — a fan, music, conversation or a TV in the room competes with the string's pitch and can visibly disturb the reading, especially on the lower, slower-vibrating strings. Multiple strings ringing together, a buzzing fret, or a microphone positioned far from the instrument all reduce accuracy further. Treat a borderline reading as "close, verify by ear" rather than an exact measurement, and expect the low strings to take a moment longer to settle than the high ones purely because their vibration is slower to begin with.

The tuning presets (Standard, Drop D, Half-step down, Open G, DADGAD) cover six-string guitar only; there is no bass or ukulele preset, though the underlying pitch detector will still report a frequency and nearest note for any pitched instrument.