Square Wave Generator

You Might Also Need

Square Wave Generator produces the classic two-level waveform with a fixed fifty percent duty cycle, the shape behind the hollow, buzzy tone of early digital and analogue electronics. Frequency, duration and amplitude are adjustable.

What is Square Wave Generator?

Three controls, one fixed shape: enter a frequency, a duration and an amplitude, and the file is synthesised with the waveform switching between its two levels exactly halfway through each cycle.

What the panel offers:

  • Frequency from one hundredth of a hertz to twenty thousand, with a fine step and a default of 220 hertz.
  • Duration from a tenth of a second to sixty seconds, defaulting to three.
  • An amplitude slider from one to one hundred percent, defaulting to fifty.
  • A sample rate choice of 44.1 or 48 kilohertz for the generated file.

The waveform alternates between full positive and full negative, switching as the fractional part of the phase crosses one half, and it always begins at the positive level. That two-level construction is what gives a square its harmonic signature: only odd multiples of the fundamental are present, at three, five, seven times and so on, each falling in level as one over its order. The result is a tone with a strong fundamental and a moderately bright edge, less bright than a sawtooth, which contains both odd and even harmonics, and considerably brighter than a triangle. Two limitations follow from the synthesis. First, the transitions are instantaneous, which means the ideal square contains energy extending infinitely upward; in a discrete signal that content above the Nyquist limit folds back as aliasing. Second, these oscillators do no band-limiting, so the aliasing is real at high frequencies. At a low fundamental it is inaudible, but a square wave at several kilohertz will not be a clean square after sampling, and nothing in this tool can prevent that. For measurement work the shape is also a convenient way to see how a system handles a step: an ideal square changes level instantly twice per cycle, so ringing, slew limiting or overshoot introduced anywhere in the chain changes the shape when the output is viewed on an analyser or a scope. Nothing among the settings alters the duty, so the harmonic balance is fixed by the shape itself rather than by anything you can adjust.

Where the waveform behaves differently from the ideal:

  • There is no band-limiting, so harmonics above Nyquist alias rather than being removed.
  • The duty cycle is fixed at fifty percent, with the pulse wave generator covering everything else.
  • The tone starts abruptly at full positive level, which is a step rather than a smooth onset and can click in a mix.
  • Amplitude is linear, not a decibel value.
  • The file is mono only, and capped at sixty seconds.
  • Only the fundamental and its odd harmonics are present, so no even-order content can be produced by any setting.

Use it for the things a square is good at: waking up a circuit under test, checking whether a system adds ringing to a fast edge, producing an unmistakable test signal that is easy to recognise by ear, or generating an eighties-style hollow tone to layer under a mix. When the brightness needs to be able to shift, the pulse wave generator adds a duty cycle control that moves the harmonic balance without changing the fundamental.

How to use Square Wave Generator

  1. Enter the frequency, noting that lower fundamentals alias less at the shape's edges.
  2. Set the duration and amplitude.
  3. Choose a sample rate and press generate.
  4. Preview the tone and download the WAV if it is what you need.

When to use Square Wave Generator vs related tools

Square Wave Generator is the tool when the two-level shape itself is the point, whether for testing or for its distinctive tone. Pulse Wave Generator offers the same shape with an adjustable duty cycle, and Sawtooth Wave Generator and Triangle Wave Generator cover the other classic shapes. When a cleaner reference is needed rather than a bright one, Sine Wave Generator has no harmonics at all.

Privacy & Security

This tool runs entirely in your browser — no data ever leaves your device. There is no server round-trip, no upload, no logging, and no account required. Your input is processed locally using client-side JavaScript and is never stored, transmitted, or accessible to anyone else. When you close the tab, everything disappears.

Frequently asked questions about Square Wave Generator