Clever Quest Lab Tools

Instrument Tuner

Tune a guitar, bass, ukulele, violin, viola, cello or mandolin, or any other instrument in chromatic mode, with your device's microphone. The meter shows the note, how many cents it is off and the frequency in hertz, and every string has a reference tone you can play.

Tuner

The microphone is off. Press Start tuner and allow microphone access, then play one string at a time.

Sound is analysed in your browser and is not uploaded. Nothing is recorded.

Tuning meter from 50 cents flat on the left to 50 cents sharp on the right; the green band in the middle is in tune (plus or minus 5 cents) ♭ flat sharp ♯ ◀ ▶

Strobe band: the stripes drift right when the note is sharp, left when it is flat, and stand still when it is in tune.

Strings

Auto-detect follows the string closest to the note you play. Select a string to tune only that one; Play sounds its reference tone.

A reference tone keeps playing until you press Stop or Esc.

Settings

Allowed range 415–466 Hz. 440 Hz is the international standard.

Move right in a noisy room, left for a quiet instrument or a distant microphone. The black mark on the input bar shows the gate.

Frequency to note

Nearest note
–

Target frequencies

StringNoteFrequencyMIDI

Frequencies use equal temperament: each semitone is a factor of 21/12 from A4.

Runs on your device. Uses your microphone; the sound is processed on your device. Nothing you type or record is uploaded. Keeps working without a connection while the page is open. Works with touch. Saves your instrument, A4 pitch, noise gate and reference tone settings on this device.

Added · Updated : the answer on cents no longer quotes an unsourced 5 to 6 cent hearing limit

How to use the instrument tuner

  1. Choose your instrument and tuning, or Chromatic for any other instrument or for singing.
  2. Press Start tuner and allow the microphone when the browser asks. Hold the phone or laptop near the instrument.
  3. Play one string and let it ring. The big letter is the target note, the number is the deviation in cents, and the needle shows the same on a scale from 50 cents flat to 50 cents sharp.
  4. If the reading says ▲ Flat – tune up (too low), tighten the string; if it says ▼ Sharp – tune down (too high), loosen it. When the needle sits in the green band and the text says ✓ In tune, you are within ±5 cents.
  5. With Auto-detect string on, the tuner follows the string closest to the note you play. If a string is far out of tune, select that string instead so the tuner measures against it. Play sounds a reference tone if you prefer to tune by ear.

How it works

A tuner finds the frequency of the note and compares it with the target. This page reads about 80 milliseconds of microphone sound at a time and uses YIN, a well-known pitch detection method. It computes a difference function for every possible period τ (a lag in samples):

d(τ) = Σ (xj − xj+τ)²

where xj are the samples of a 40 ms window. If the sound repeats every τ samples, d(τ) is close to zero. YIN divides d(τ) by its running average so the values become comparable, and takes the first lag that falls below a threshold. Taking the first dip rather than the deepest one is what stops a guitar's strong overtones from being reported an octave too low.

The whole-sample lag is then refined: the page fits a parabola to the normalised autocorrelation around its peak and repeats the fit at the largest multiple of the period that fits in the analysed sound (about 40 periods for a note near 1 kHz), which divides the remaining error by that multiple. The frequency is f = sample rate / τ. After silence the display waits for three agreeing readings, then shows the median of the last five, so stray frames are ignored.

The note comes from equal temperament with A4 as the reference:

n = 69 + 12 · log2(f / A4)

Rounding n gives the nearest note (69 is A4, 60 is middle C, C4). The target frequency is A4 · 2(n − 69)/12 and the deviation in cents is

cents = 1200 · log2(f / ftarget)

A cent is one hundredth of an equal-tempered semitone; 1200 cents make an octave. In an instrument preset the target is the selected or nearest string instead of the nearest note.

Examples

Type these into the Frequency to note calculator above (A4 = 440 Hz unless stated).

Example 1 — an open A string. 110 Hz: n = 69 + 12 · log2(110/440) = 69 − 24 = 45, which is A2, deviation 0.0 cents. On a guitar in standard tuning that is string 5, in tune.

Example 2 — a slightly flat low E. 82 Hz: n = 39.91, rounded to 40 = E2 at 82.41 Hz, and 1200 · log2(82 / 82.41) = −8.6 cents. That is outside the ±5 cent band, so the tuner says tune up.

Example 3 — when the nearest note is the wrong one. 80 Hz: n = 39.49, so the nearest note is D♯2 (77.78 Hz) at +48.7 cents. With the guitar preset the nearest string is still E2 at −51.3 cents, which correctly tells you to tune the low E up.

Example 4 — a different reference pitch. 440 Hz with A4 set to 432 Hz: 1200 · log2(440/432) = +31.8 cents, so a note that is perfect at 440 Hz reads as A4, 31.8 cents sharp.

Standard tunings

Target frequencies at A4 = 440 Hz (the calculator above lists them for your reference pitch):

InstrumentStrings (low to high)Lowest / highest
Guitar, standardE2 A2 D3 G3 B3 E482.41 / 329.63 Hz
Bass guitar, 4-stringE1 A1 D2 G241.20 / 98.00 Hz
Ukulele, standardG4 C4 E4 A4 (the G is high)261.63 / 440.00 Hz
Violin and mandolinG3 D4 A4 E5196.00 / 659.26 Hz
ViolaC3 G3 D4 A4130.81 / 440.00 Hz
CelloC2 G2 D3 A365.41 / 220.00 Hz

The guitar presets also include Drop D (the low string down to D2, 73.42 Hz), DADGAD (D2 A2 D3 G3 A3 D4) and Open G (D2 G2 D3 G3 B3 D4).

Tips for accurate tuning

Which A4 should I use?

440 Hz is the international standard concert pitch and right for nearly all bands, schools and recordings. Some orchestras tune slightly higher, often 442 or 443 Hz. Many baroque ensembles use 415 Hz, about a semitone lower; 466 Hz is about a semitone higher. If you play along with a piano or a recording, match its A4.

Frequently asked questions

How accurate is this tuner?

The frequency estimate is refined between samples, as described above, so on a clean, steady note the arithmetic is not the weak point. In practice the limits are your microphone, room noise and the instrument itself. The in-tune band is ±5 cents, a common tuning tolerance.

Why is there no reading?

The sound is below the noise gate, or several notes or a lot of noise are heard at once. When the input bar stays left of the black mark, play louder, move closer or lower the gate.

What are cents?

A cent is 1/100 of a semitone. The smallest pitch difference people can hear varies from person to person and with the sound, so the ±5 cent in-tune band is a working tolerance, not a limit of hearing.

Can I tune by ear with the reference tone?

Yes. Press Play and match your string to the tone; when the two are close you hear slow beats, which stop when they match. The warm sound has overtones, so low strings are audible even on small speakers.

Sources