Tone generator — play a pure frequency

Set a frequency from 20 Hz to 20,000 Hz, pick a waveform, and press Play. The nearest musical note, its octave and the cents offset update live underneath the frequency. Everything runs locally in your browser — nothing you set here is uploaded anywhere.

How it works

Under the hood this is a short Web Audio graph: an OscillatorNode generates the waveform at your chosen frequency, feeds into a GainNode that controls volume, which connects to your device's audio output. That is the entire signal path — no effects, no processing, no recording.

Why the tone doesn't click when it starts or stops

Jumping an oscillator straight from silence to full volume (or the reverse) almost always produces an audible click or pop, because the waveform gets cut off mid-cycle rather than crossing zero. This tool ramps the gain smoothly over about fifteen milliseconds on every start, stop and volume change instead of stepping it instantly, so the tone fades in and out cleanly. Oscillators are also one-shot nodes in the Web Audio API — once stopped, a given oscillator can never be restarted — so a fresh one is created every time you press Play and discarded when you press Stop.

Why Play has to be an actual click

Browsers deliberately restrict audio from starting on its own, so a page cannot autoplay sound the moment it loads. The audio engine here is created — and, if the browser suspended it, resumed — inside the Play button's own click handler, which is exactly the kind of user gesture that policy requires. Building it any earlier, or inside code that runs after the click has already finished, risks the audio engine staying silently suspended.

The logarithmic slider

The frequency slider doesn't move linearly through 20-20,000 Hz — it moves linearly through the logarithm of frequency. That matches how pitch is actually perceived: the jump from 100 Hz to 200 Hz sounds like the same musical interval (an octave) as 5,000 Hz to 10,000 Hz, even though the second gap is fifty times larger in raw hertz. A linear slider would crowd the entire audible range most people actually listen in — below a few kilohertz — into a sliver at one end.

The four waveforms

All four waveforms here play at the same fundamental frequency; what differs is which additional harmonics ride along with it, and that difference is what your ear hears as timbre.

Waveform harmonic content and typical character
WaveformHarmonicsTypical character
SineNone — fundamental onlyThe closest thing to a "pure" tone; the standard choice for tuning and calibration
SquareOdd harmonics (3x, 5x, 7x...) at large amplitudeHollow, buzzy — classic 8-bit game sound
SawtoothEvery harmonic, odd and evenBright and brassy — common synth lead/bass waveform
TriangleOdd harmonics, falling off fastSoft and rounded — closer to a flute or whistle

Note names and cents — the math

The nearest note is found by converting frequency to a fractional MIDI note number, using A4 = 440 Hz as the reference pitch (MIDI note 69) and the standard 12-tone equal-tempered relationship, where each semitone is a factor of the twelfth root of two:

midi = 69 + 12 * log2(freq / 440) nearest = round(midi) cents = round((midi - nearest) * 100)

Rounding midi to the nearest whole number gives the nearest semitone; the leftover fraction, multiplied by 100, is how many cents sharp or flat your exact frequency is from that note's textbook pitch. A cent is 1/100 of a semitone, so it always falls in a window of roughly ±50 cents around whichever note is nearest — anything further than that and a different note would be nearer instead.

Reference frequencies for standard 12-tone equal temperament, A4 = 440 Hz
NoteFrequencyMIDI
C4 (middle C)261.63 Hz60
E4329.63 Hz64
G4392.00 Hz67
A4 (concert pitch)440.00 Hz69
A#4 / Bb4466.16 Hz70
C5523.25 Hz72

Try any of these in the tool above — the readout should land within a cent or two of 0.

Use cases & honest limitations

Where this is genuinely useful

  • Tuning instruments by ear. Play a reference pitch — A440 is the standard concert-pitch tone, on its own page — and tune against it, the way generations of musicians tuned against a piano, a tuning fork or an oboe's A.
  • Testing speakers and headphones. Sweep the frequency slider slowly from low to high and listen for buzzing, dropouts, or a driver going quiet in a particular range.
  • Rough tinnitus pitch-matching. Sweeping to find the frequency that sounds closest to a ringing or whining sound can help you describe it — this is informal and not a diagnostic tool; see a doctor or audiologist for anything more.
  • Sound design and foley reference. A clean, exact frequency is a useful reference tone against a synth, a mix, or another piece of gear.
  • Teaching the physics of sound. Hearing the pitch change smoothly as frequency changes, and hearing four waveforms at an identical frequency, makes the harmonic-content explanation above tangible rather than abstract.

What this tool cannot do

  • It cannot tell you an absolute sound pressure level. How loud the tone actually is depends on your device's volume, its amplifier, and your speakers or headphones — none of which this page has any way to see or control. The same 50% volume setting can be silent on one device and painfully loud on another.
  • It is not a calibrated instrument. The frequency you request is accurate to your device's audio clock, which on ordinary consumer hardware is extremely precise but was never certified as a laboratory reference.
  • It plays one oscillator at a time. No chords, no dual-tone beating, no built-in vibrato — a single steady frequency and waveform.
  • Perceived loudness is not flat across frequency. The same gain setting can sound noticeably louder or quieter depending on the frequency, which is a property of human hearing, not of the tool — see the FAQ below.
  • It is not medical equipment. Nothing here diagnoses hearing loss or tinnitus, and none of the tinnitus-matching use above should be read as more than an informal, non-diagnostic aid.

A note on hearing safety. A pure tone gives no natural loudness cues the way speech or music does, and it is very easy to set a level that feels fine for a second and is uncomfortably — or dangerously — loud a moment later, especially through headphones. Start at low volume, raise it gradually, and stop immediately if anything feels too loud. The same caution applies to speakers: a sustained tone near a driver's resonant frequency at high volume can damage it.

Frequently asked questions

Why doesn't anything play when I click Play?

Check your system and browser volume first — it is the most common cause. Browsers also require a real click before they will start audio at all (an autoplay policy this button already satisfies), so a tone that was somehow triggered without a click would legitimately stay silent. If another app or browser tab currently has exclusive control of your audio device, that can block playback too. Finally, this needs JavaScript and the Web Audio API; a very old or locked-down browser may not expose either.

What do the note name and cents next to the frequency mean?

The tool converts the frequency you set into the nearest note on the standard 12-tone equal-tempered scale (A4 = 440 Hz) plus its octave, for example A4 or C#5. Cents measure how far your exact frequency sits from that note's textbook pitch, where 100 cents equal one semitone. 445 Hz reads as A4 and about +20 cents — a little sharp of A4, not yet a quarter of the way to A#4.

Why is 440 Hz used as a tuning reference?

440 Hz is the internationally standardized concert pitch for the A above middle C, formalized so that orchestras, instrument makers and recordings agree on a common reference. It was not always 440 — pitch standards drifted for centuries, and some orchestras today tune slightly sharp of it (442-443 Hz) for a brighter sound, while historically-informed Baroque ensembles often tune around 415 Hz, roughly a semitone lower. See the dedicated 440 Hz tone page for more.

Can I use this to test my speakers or headphones?

Yes — sweeping the frequency slider from low to high is a quick way to listen for rattles, dropouts, or a driver that goes quiet at a particular range. It cannot tell you the actual sound pressure level reaching your ears, though: the loudness you hear depends on your device's volume setting, its amplifier and its speaker or headphone response, none of which this tool can see or measure.

Can this help me find the pitch of my tinnitus?

Some people use a tone generator informally to sweep for the frequency that most closely matches a ringing or whining sound they hear, as a way of describing it more precisely. This is not a medical or diagnostic tool, it has not been validated for that purpose, and it cannot measure loudness, masking level, or anything else an audiologist's equipment does. If tinnitus is affecting you, talk to a doctor or audiologist rather than relying on this page.

Why does the same volume setting sound louder at some frequencies than others?

Human hearing is not equally sensitive across the audible range — perceived loudness at a fixed physical level varies with frequency, typically peaking in the range human speech sits in and dropping off toward the very low and very high ends. This is a well-documented property of hearing itself (formalized in equal-loudness-contour standards), not a flaw in the tool: the volume slider sets the same electrical gain regardless of frequency, and your ears do the rest.

What's the difference between the four waveforms?

A sine wave contains only the fundamental frequency and nothing else, so it is the closest thing to a "pure" tone and the standard choice for tuning or calibration. A square wave adds odd harmonics (3x, 5x, 7x the fundamental) at large amplitudes, giving it a hollow, buzzy, retro-videogame character. A sawtooth wave contains every harmonic, odd and even, which is what gives it a bright, brassy, synth-lead quality. A triangle wave has only odd harmonics like a square wave, but they fall off much faster, so it sounds softer and closer to a flute or whistle.

Why does the frequency range stop at 20 Hz and 20,000 Hz?

20 Hz to 20,000 Hz is the commonly cited nominal range of human hearing. Very few adults actually hear all the way to 20 kHz — the upper limit typically falls with age, often well below 15 kHz by adulthood — and almost nobody perceives anything below about 20 Hz as a pitch rather than a felt vibration. The slider is capped at that textbook range because going further would mostly generate frequencies nobody in the room can actually hear.

Is anything I do here recorded or sent anywhere?

No. The tone is generated locally by your browser's Web Audio API and sent straight to your device's audio output — there is no server call, no upload, and no account. Your frequency, waveform and volume choices exist only in this page's memory and disappear when you leave it.

Go deeper