Tone Generator

This page plays a pure tone with the Web Audio API at any frequency from 1 Hz to 22,000 Hz. Concert pitch A4 is 440 Hz, and each octave doubles the frequency, so A5 is 880 Hz and A3 is 220 Hz. A link such as ?freq=440&wave=sine&vol=20&ch=both opens the page with those values set, and the sound starts only when you press Play.

Presets

Wave

Channel

Did this solve your problem?
Prefer us on Google

How to use

  1. Type a frequency in Hz, drag the slider (it is logarithmic, so low and high pitches get equal room) or tap a preset such as 60, 440 or 1000 Hz.
  2. Fine tune with the -10, -1, +1 and +10 buttons, or jump an octave with x2 and /2.
  3. Choose a wave shape (sine, square, sawtooth or triangle), the channel (both, left or right) and a low volume.
  4. Press Play to start and Stop to end. Changes you make while it plays are applied right away. The note shown is the closest equal-tempered note with A4 = 440 Hz and the difference in cents.

How it works

Note: n = 69 + 12 x log2(f / 440) gives the MIDI note number, which is rounded to the nearest whole note. Cents = (n - rounded n) x 100, so 450 Hz is A4 +39 cents.

Octave: doubling the frequency raises the pitch by one octave (12 semitones), so 440 Hz doubles to 880 Hz.

Period = 1000 / f in milliseconds. Wavelength in air = 343 / f in meters, using a speed of sound of 343 m/s at 20 C.

Wave shapes: a sine wave is a single frequency. Square, sawtooth and triangle waves add harmonics (odd multiples for square and triangle, all multiples for sawtooth), so they sound brighter. The browser uses the standard Web Audio OscillatorNode for all four.

Volume 0 to 100 is mapped to an output gain of (volume / 100)^2 x 0.5, which keeps the maximum well below full scale. Each start and stop fades over a few milliseconds so there is no click.

FAQ

Why can I not hear very low or very high tones?

Most people hear about 20 Hz to 16,000 Hz, and the upper limit falls with age. Laptop speakers and many earphones also cannot reproduce anything below roughly 80 Hz. Use headphones for low tones, and see the hearing frequency test to find your own range.

Is it safe to play loud tones?

Start at a low volume and raise it slowly. A steady pure tone at a high level can damage hearing or speakers, especially square and sawtooth waves and very high or very low frequencies.

Why does the sound not start when I open a shared link?

Browsers block audio until you interact with the page. A link only fills in the values. Press Play to hear it.

Can I use it to tune an instrument?

Yes for a reference pitch such as A4 = 440 Hz or the open strings of a guitar (82.41, 110, 146.83, 196, 246.94 and 329.63 Hz). The tone is generated by your device clock and is accurate enough for tuning.