How Morse Code Is Structured

Morse code encodes information as sequences of two signal types: a short signal (called a dit or dot) and a long signal (called a dah or dash). Every letter, digit, and common punctuation mark has a unique dit-dah sequence. The code was designed so that the most frequently used letters in English have the shortest sequences — E is a single dit, T is a single dah — which maximises transmission speed for typical English text.

Beyond the individual signal elements, the structure of Morse code depends critically on timing. A Morse message isn't just a sequence of dots and dashes — it's a precisely timed sequence of sounds and silences. The ratios between these durations are defined by international standard and must be respected for the code to be correctly decoded by a human listener.

Standard Timing Rules

All Morse timing is expressed as multiples of a base unit — the duration of a single dit. Everything else is a ratio of this unit:

These ratios are fixed regardless of speed. Speeding up Morse code means shortening the base unit; all other durations scale proportionally. A 20 WPM transmission has exactly the same element-to-gap ratios as a 5 WPM transmission — the 20 WPM version is simply faster.

The words-per-minute measure is calibrated against the word "PARIS" (chosen because it represents the average letter complexity of typical English text). One WPM means you could send "PARIS" once per minute. At 20 WPM, "PARIS" would be sent 20 times per minute — approximately once every three seconds.

Farnsworth Timing

Standard timing scales everything uniformly with speed. Farnsworth timing is a variant used for training, where the individual characters are sent at a higher speed but the gaps between letters and words are stretched out. This exposes the learner to the actual rhythmic "feel" of fast characters while giving them more time to decode each one before the next arrives.

For example, you might send characters at 20 WPM but use 5 WPM inter-character spacing. As the learner improves, the inter-character gap is reduced until both match. Farnsworth timing is considered more effective than starting at a uniformly slow speed because it develops the correct auditory recognition of fast character patterns from the beginning, rather than training the learner to decode slow characters that sound different from fast ones.

The Web Audio API Approach

The generator produces audio using the browser's native Web Audio API — no external audio files, no server requests. An OscillatorNode generates a pure sine wave at the configured frequency. Each dit and dah is a precisely scheduled segment of oscillator output; each gap is a period of silence, implemented by stopping the oscillator or reducing gain to zero.

Scheduling is done using the AudioContext.currentTime high-resolution clock, which operates in seconds with sub-millisecond precision. This is significantly more precise than setTimeout, which can drift substantially at high rates — critical for Morse, where the timing ratios must be accurate for the result to be decodable.

The WAV download works by rendering the entire audio sequence offline using an OfflineAudioContext, then encoding the resulting buffer as a WAV file in JavaScript and triggering a download. The offline render is faster than real-time, so even long messages generate quickly.

WPM Speed Presets

The generator supports a range of speeds suited to different use cases:

Practical Uses Today

Morse code has a smaller but persistent presence in the modern world:

Generate Morse code audio from any text.
Adjustable tone and WPM speed — play in browser or download as WAV.

Open Morse Code Generator →