b2KIT

Tone Generator

Generate sine, square, triangle, and sawtooth wave tones at any frequency.

Tested tool guide Tested browser tools Checked August 16, 2026

What Tone Generator does, with a checked example

Type a frequency in hertz, pick one of four waveforms, and the page plays a continuous tone at that pitch until you stop it. The sound is synthesized locally as a real-time stream of digital samples at the audio device's sample rate, so no audio file is needed and nothing is uploaded. The thing most people get wrong: what you hear is not the clean curve in the textbook diagram. A square or sawtooth 'at' 220 Hz carries many higher harmonics, so it sounds buzzy and much brighter than a sine at the same frequency. The sine is the only pure, flute-like tone.

Worked example

A concrete input and expected output from the current implementation.

Input

Waveform: sine, frequency: 440

Expected output

A continuous 440 Hz sine tone plays until you press Stop. 440 Hz is A4, the note above middle C and the international concert-pitch reference (ISO 16). Doubling to 880 Hz would give A5, one octave higher.

A4 is defined as 440 Hz by the standard tuning convention, so this is the pitch orchestras tune to. The oscillator outputs exactly one frequency, heard as a steady pure beep.

How the result is produced

1

Synthesis

The page builds the tone as a stream of samples at the audio device's sample rate, commonly 44,100 or 48,000 per second. For each sample it evaluates the waveform's defining formula: a sine is sin(2*pi*f*t), while the square, triangle, and sawtooth shapes come from their own piecewise definitions. The samples feed the output at the set volume, so the tone plays continuously and in real time until stopped.

2

Pitch and audibility

Pitch perception is logarithmic: doubling the frequency raises the tone exactly one octave, so 220, 440, and 880 Hz are the same note, A, in three octaves. Human hearing spans roughly 20 Hz to 20 kHz, but both ends are unreliable: most adults lose sensitivity above about 17 kHz, and small speakers reproduce little below 100 Hz.

Good uses

  • Tune an instrument: play 440 Hz and tune the A string of a violin, viola, or guitar against it; 261.63 Hz gives middle C (C4) for a cello or piano reference.
  • Audition speakers or headphones: sweep the frequency range to hear which bass and treble a device actually reproduces and where the response drops off.
  • Diagnose audio problems: match a hum, a ringing, or a room resonance against generated tones to identify its frequency before treating it.

Limits and checks

  • Silence is not failure. Above roughly 17-20 kHz the tone is out of most adult hearing, and deep bass below the speaker's capability produces little audible output, even though the oscillator is running.
  • The waveform changes what you hear more than the readout suggests. A square or sawtooth at the same frequency is perceived as louder and harsher than a sine because of its harmonic content, so comparing levels across waveforms is not apples-to-apples.
  • The browser's autoplay policy starts audio only after a user interaction, so the tone begins when you press Play. Keep the volume low at first: at full level a square wave is loud and startling, and iOS silences audio when the screen locks or the tab is backgrounded.

Common questions

What is 440 Hz, and why does it matter?

It is A4, the A above middle C, set as the international standard tuning frequency (ISO 16). Orchestras and tuners align to it, so most music you hear is tuned with A4 at 440 Hz. For reference, middle C is 261.63 Hz, and 880 Hz is A5, one octave above 440.

Why does the square wave sound harsh and nothing like a pure note?

Because a square wave is not one pitch. It is the fundamental plus its odd harmonics at 3x, 5x, 7x the frequency, and a sawtooth contains every harmonic. That stack of extra pitches is exactly the buzzy, aggressive character you hear, and it is the defining difference between the waveforms, not a defect.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools