🎸 Guitar Tuner
Click a string to hear its reference tone with natural harmonics
The Harmonic Series
Every musical tone contains a fundamental frequency and its integer multiples
Deep Dive
The science and craft behind tuning
When you pluck a guitar string, it does not vibrate at just one frequency. The string oscillates simultaneously at its fundamental frequency and at every integer multiple of that frequency. These additional frequencies are called harmonics or overtones. The fundamental (1f) is the pitch we perceive as the "note," while the overtones blend together above it, shaping the character of the sound. The second harmonic (2f) is one octave above the fundamental, the third (3f) is an octave plus a perfect fifth, the fourth (4f) is two octaves up, and so on, mapping neatly onto the intervals of Western music.
The relative loudness of each harmonic is what gives an instrument its distinctive timbre. A nylon-string classical guitar emphasizes lower, even-numbered harmonics, producing a warm, round tone. A steel-string acoustic guitar has stronger upper harmonics, giving it more brightness and cut. An electric guitar with a humbucker pickup rolls off high-frequency harmonics, while a single-coil pickup lets them through, resulting in a thinner, more biting sound. Even though all three instruments can play the same A at 440 Hz, your ear instantly tells them apart because their harmonic fingerprints are different.
Guitarists exploit harmonics directly by lightly touching a string at fractional points along its length. Touching the string at the 12th fret (the halfway point) isolates the second harmonic, producing a bell-like tone one octave higher. The 7th fret isolates the third harmonic, and the 5th fret isolates the fourth. These natural harmonics are not just parlor tricks; they are essential tools for tuning, creating chime-like textures in songs, and even checking intonation across the fretboard.
Standard guitar tuning is E A D G B E, from the lowest (thickest) string to the highest (thinnest). The interval between most adjacent strings is a perfect fourth -- five semitones. The exception is the gap between G and B, which is a major third (four semitones). This asymmetry is a deliberate design choice rooted in centuries of tradition. Tuning in pure fourths would make scale patterns perfectly uniform across all strings, but it would also make common open chords like C, G, and D impossible to finger comfortably. The major-third break between G and B keeps open chord shapes compact enough for the average human hand.
This tuning arrangement has deep consequences for how guitarists think about music. Because of the major-third irregularity, any scale shape or chord voicing that crosses the G-B boundary must shift up by one fret compared to what pure-fourths geometry would predict. This is why guitarists memorize multiple "positions" and "CAGED shapes" rather than a single movable pattern. Bass players, by contrast, tune in straight fourths (E A D G) and enjoy perfectly symmetrical fingering across the entire neck. Some guitarists -- notably jazz players like Stanley Jordan and Alex Hutchings -- adopt all-fourths tuning (E A D G C F) to gain that same symmetry, trading away easy open chords for consistent interval logic.
The frequencies of standard tuning follow the equal-temperament scale. The low E2 vibrates at 82.41 Hz, A2 at 110.00 Hz, D3 at 146.83 Hz, G3 at 196.00 Hz, B3 at 246.94 Hz, and the high E4 at 329.63 Hz. Each perfect fourth represents a frequency ratio of approximately 4:3 (or precisely 2^(5/12) in equal temperament, about 1.3348). The major third from G to B is a ratio of about 1.2599. These precise ratios are what this tuner reproduces when you click each string button above, giving you a reliable reference pitch to tune against.
Detecting the pitch of an audio signal is a surprisingly nuanced problem. The two most common families of algorithms are autocorrelation and FFT-based spectral analysis. Autocorrelation works by comparing a signal with delayed copies of itself. When the delay equals the period of the fundamental frequency, the correlation peaks sharply. This approach is robust for monophonic signals and handles missing fundamentals well -- if the fundamental is quiet but the overtones are strong, autocorrelation still finds the correct period. YIN and pYIN are popular refined versions that add parabolic interpolation and probabilistic smoothing to reduce octave errors.
FFT-based methods transform the time-domain waveform into a frequency spectrum, revealing the amplitude at each frequency bin. A 2048-sample FFT at a 44,100 Hz sample rate gives a frequency resolution of about 21.5 Hz per bin -- too coarse for precise tuning, where a semitone at 440 Hz is only about 26 Hz wide. To improve resolution, algorithms use zero-padding (appending zeros to the signal before the FFT) or spectral interpolation (fitting a parabola around the peak bin). Harmonic product spectrum (HPS) is another technique: it downsamples the spectrum at integer ratios and multiplies the results, causing the fundamental to emerge as the strongest peak even when overtones dominate the raw spectrum.
The tuner on this page takes a different approach: rather than detecting pitch from a microphone, it synthesizes reference tones using the Web Audio API. Each string button triggers an OscillatorNode at the exact target frequency, layered with overtones at 2f, 3f, 4f, and 5f to simulate a guitar-like timbre. The waveform canvas uses an AnalyserNode to read time-domain sample data and draw the composite wave in real time. This gives you a visual confirmation that the tone contains harmonics -- you can see the complex wave shape rather than a pure sine wave -- while your ear compares the synthesized reference against your actual string to detect beats and tune by ear.