Introduction
Morse code is not just dots and dashes on a screen. It is a sound. Operators learn it by ear, hearing tones at specific intervals, and the timing between elements carries as much information as the elements themselves. This tool generates Morse code audio from text using the Web Audio API, with adjustable speed (WPM) and tone frequency. It also decodes Morse audio from your microphone in real time, detecting tone and silence durations to reconstruct the dots and dashes. You can download the generated audio as a WAV file. Everything runs in your browser.
What this tool does
- Convert text to Morse code and play it as audio using a sine wave oscillator at your chosen frequency (400-1000 Hz)
- Decode Morse code audio from your microphone in real time, detecting tones in the 600-800 Hz range and classifying them as dots or dashes based on duration
- Decode manually entered Morse code (dots, dashes, spaces between letters, slashes between words) back to text
- Generate downloadable WAV files (44.1 kHz, 16-bit PCM, mono) of the Morse code audio for offline use
- Adjust speed from 5 to 60 WPM using the PARIS standard (unit duration = 1200 / WPM milliseconds)
- Display the full Morse code alphabet (A-Z, 0-9) with their dot-dash patterns for reference
How this tool works
The tool uses the Web Audio API for both playback and recording. For playback, it creates an AudioContext and schedules sine wave oscillator segments for each tone event. The timing follows the PARIS standard: a dot is 1 unit, a dash is 3 units, the gap between elements within a letter is 1 unit, the gap between letters is 3 units, and the gap between words is 7 units. The unit duration is calculated as 1200 / WPM milliseconds, so at 20 WPM one unit is 60ms, a dot is 60ms, and a dash is 180ms.
Each tone event uses a gain node with a 5ms fade in and fade out to prevent clicks at the start and end of the tone. The oscillator runs at the selected frequency (default 700 Hz, which is in the typical amateur radio CW range of 600-800 Hz). The tool schedules all events on the audio context timeline so they play back without gaps.
For WAV download, the tool generates a PCM audio buffer directly in JavaScript. It writes the WAV header (RIFF, fmt, data chunks) and fills the sample buffer with sine wave samples for tone events and silence for gaps, applying the same fade in/out to avoid clicks. The resulting WAV file is 44.1 kHz, 16-bit, mono.
For microphone decoding, the tool uses getUserMedia to access the microphone, creates a MediaStreamSource, and connects it to an AnalyserNode with FFT size 4096. It monitors the frequency bins in the 600-800 Hz range for energy above a threshold (100 on the 0-255 byte frequency scale). When energy rises above the threshold, a tone starts. When it falls below, the tone ends and the duration is classified: less than 2 units is a dot, 2 or more units is a dash. Silence durations are classified similarly: 2-5 units is a letter gap, 5+ units is a word gap. The detected Morse code and decoded text update in real time.
How Morse code audio and timing work (ITU-R M.1677)
Morse code was developed by Samuel Morse and Alfred Vail in the 1830s for use with the electric telegraph. The international standard for Morse code is defined in ITU-R M.1677, which specifies the code assignments for letters, digits, and punctuation, as well as the timing rules for transmission.
The PARIS standard for speed measurement comes from the word 'PARIS,' which has a precise duration of 50 units (including the word gap that follows it). Since 1 unit = 1200 / WPM milliseconds, the word 'PARIS' takes exactly 60,000 / WPM milliseconds = 60 / WPM seconds. At 20 WPM, 'PARIS' takes 3 seconds. This makes WPM a convenient and standardized measure of Morse code speed. The word was chosen because it has a representative mix of dots and dashes and its duration works out to exactly 50 units.
The timing ratios are fixed by the ITU standard: dot = 1 unit, dash = 3 units, intra-element gap = 1 unit, inter-letter gap = 3 units, inter-word gap = 7 units. These ratios are the same regardless of speed. Only the unit duration changes with WPM. At 5 WPM (beginner speed), a unit is 240ms. At 20 WPM (typical operator speed), a unit is 60ms. At 40 WPM (expert speed), a unit is 30ms.
The tone frequency for CW (Continuous Wave) Morse transmission is typically in the 600-800 Hz range. This is not the radio frequency, but the audio beat frequency that the receiver produces when mixing the incoming CW signal with a local oscillator. The human ear is most sensitive around 700-1000 Hz, which is why operators prefer tones in this range. The ITU standard does not specify a tone frequency, leaving it to the operator's preference and equipment.
For learning Morse code, the Koch method and Farnsworth method are common approaches. The Koch method introduces characters one at a time at full speed, building proficiency through gradual addition. The Farnsworth method uses standard character timing but extends the inter-letter and inter-word gaps to give beginners more processing time. This tool uses standard timing (not Farnsworth), but you can simulate Farnsworth timing by lowering the WPM setting.
How to use this tool
- Select Encode (text to audio) or Decode (audio to text) mode
- For encoding: type or paste text in the input field. The tool converts it to Morse code and displays the dot-dash pattern
- Adjust the speed (5-60 WPM) and frequency (400-1000 Hz) using the input fields. The timing panel shows the resulting dot, dash, and gap durations
- Click Play to hear the Morse code audio through your speakers, or Download WAV to save the audio file
- For decoding via microphone: click Start Recording, allow microphone access, and play a Morse code tone near your device. The tool detects tones in the 600-800 Hz range and decodes in real time
- For manual decoding: type dots and dashes in the input field, using spaces between letters and slashes between words (e.g. '... --- ...' for SOS)
Real-world examples
Generating SOS at 20 WPM
Input: `SOS`. The Morse code is `... --- ...`. At 20 WPM, the unit duration is 60ms. Each dot is 60ms, each dash is 180ms. The total duration is: 3 dots (3 * 60 + 2 * 60 gap) + letter gap (120ms) + 3 dashes (3 * 180 + 2 * 60 gap) + letter gap (120ms) + 3 dots (3 * 60 + 2 * 60 gap) = 300 + 120 + 660 + 120 + 300 = 1500ms (1.5 seconds). The default frequency is 700 Hz. Click Play to hear it, or Download WAV to save it.
Decoding a tone from your microphone
Switch to Decode mode and click Start Recording. Play a Morse code tone (from another browser tab, a radio, or a tone generator) at approximately 700 Hz near your microphone. The tool monitors the 600-800 Hz frequency range. When it detects a tone shorter than 2 units (120ms at 20 WPM), it records a dot. When it detects a tone of 2 or more units, it records a dash. Silences of 2-5 units trigger a letter boundary. Silences of 5+ units trigger a word boundary. The detected Morse code and decoded text appear in real time.
Manual decoding of a Morse string
Input: `.... . .-.. .-.. --- / .-- --- .-. .-.. -..` with mode set to Decode. The tool splits on slashes for word boundaries and on spaces for letter boundaries. Each letter is looked up in the reverse Morse map: `....` = H, `.` = E, `.-..` = L, `.-..` = L, `---` = O, `.--` = W, `---` = O, `.-.` = R, `.-..` = L, `-..` = D. The decoded text is `HELLO WORLD`.
Adjusting speed for learning
Set WPM to 5 for beginner speed. The unit duration becomes 240ms. A dot is 240ms, a dash is 720ms, and the inter-letter gap is 720ms. This gives a beginner time to process each character. As proficiency increases, raise the WPM to 15, then 20, then 30. At 30 WPM, a unit is 40ms, and characters fly by at a pace that requires recognizing patterns rather than counting individual dots and dashes. The timing panel shows all durations in milliseconds for reference.
Downloading a WAV file for offline use
Enter text, set WPM and frequency, then click Download WAV. The tool generates a 44.1 kHz, 16-bit mono PCM WAV file in the browser using a JavaScript ArrayBuffer. The file includes the WAV header (RIFF/WAVE/fmt/data chunks) and the audio samples with fade in/out on each tone to prevent clicks. The downloaded file can be played in any audio player, embedded in a presentation, or used for Morse code practice offline.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Web Audio API playback | Sine wave oscillator, real-time scheduling | Interactive browser playback, adjustable speed and frequency |
| WAV file download | 44.1 kHz 16-bit PCM, generated in JavaScript | Offline practice, embedding in presentations, sharing |
| Microphone detection | FFT analysis, 600-800 Hz band monitoring | Real-time decoding of live or recorded Morse tones |
| Manual text input | String parsing, reverse Morse lookup | Decoding written Morse code without audio |
| Farnsworth timing | Standard character timing, extended gaps | Beginner learning (not directly supported, simulated via low WPM) |
Limitations or considerations
Microphone detection requires browser permission and a reasonably quiet environment. Background noise in the 600-800 Hz range can trigger false tone detections. The tool uses a fixed amplitude threshold (100 on the 0-255 scale) and monitors the 600-800 Hz band, which works well for clear tones but may struggle with noisy signals or tones outside that frequency range.
The detection algorithm classifies tones based on duration thresholds relative to the current WPM setting. If the incoming Morse code is at a different speed than the WPM you have selected, the dot/dash and letter/word classifications may be incorrect. Set the WPM to match the speed of the incoming signal before starting recording.
This tool does not implement Farnsworth timing (where character elements are sent at full speed but inter-character gaps are extended). You can approximate it by lowering the WPM, but the character timing will also slow down. For dedicated Farnsworth practice, use a specialized Morse code training application.
The WAV download produces an uncompressed PCM file. For long messages at low WPM, the file size can be large (approximately 88 KB per second of audio at 44.1 kHz, 16-bit mono). For shorter messages this is not a problem.
The tool processes only standard Morse code characters (A-Z, 0-9, and common punctuation). Non-Latin characters, accented letters, and extended prosigns are not supported. For text-based Morse translation without audio, use the Morse Code Translator. For audio-based signaling tools, see Tap Code Audio. For a cipher that uses Morse code, see Fractionated Morse Cipher.
Frequently asked questions
What is the PARIS standard for Morse code speed?
The PARIS standard defines words per minute (WPM) based on the word 'PARIS,' which has a duration of exactly 50 timing units (including the word gap that follows it). Since 1 unit = 1200 / WPM milliseconds, the word 'PARIS' takes exactly 60 / WPM seconds. At 20 WPM, it takes 3 seconds. The word was chosen because it has a representative mix of dots and dashes and its unit count works out to exactly 50.
What frequency should I use for Morse code audio?
The typical range for CW (Continuous Wave) Morse code is 600-800 Hz, with 700 Hz being a common default. This is the audio beat frequency produced by the radio receiver, not the radio transmission frequency. The human ear is most sensitive around 700-1000 Hz. The ITU standard does not specify a tone frequency, so you can adjust it to your preference. This tool supports 400-1000 Hz.
How does the microphone decoding work?
The tool uses the Web Audio API's AnalyserNode to perform FFT analysis on the microphone input. It monitors frequency bins in the 600-800 Hz range for energy above a threshold. When energy rises, a tone starts. When it falls, the tone ends and its duration is classified as a dot (under 2 units) or dash (2+ units). Silence durations are classified as letter gaps (2-5 units) or word gaps (5+ units). The WPM setting determines the unit duration used for classification.
What is the ITU-R M.1677 standard?
ITU-R M.1677 is the International Telecommunication Union recommendation that defines the international Morse code standard. It specifies the code assignments for letters, digits, punctuation, and procedural signals, as well as the timing rules (dot = 1 unit, dash = 3 units, inter-element gap = 1 unit, inter-letter gap = 3 units, inter-word gap = 7 units). It is the current international standard for Morse code.
Can I use this tool to learn Morse code?
Yes. Start at 5 WPM to hear each character slowly, then gradually increase the speed as you recognize patterns. The tool displays the Morse code alphabet for reference. For structured learning, the Koch method (adding characters one at a time at full speed) and Farnsworth method (full-speed characters with extended gaps) are common approaches. This tool uses standard timing, so lowering WPM slows everything uniformly.
Why does the downloaded WAV file sound different from the browser playback?
Both use the same sine wave at the same frequency and timing. The difference, if any, comes from your audio output device or player. The WAV file contains exact PCM samples with 5ms fades on each tone. Browser playback uses the Web Audio API's oscillator and gain nodes, which apply the same fades. If you hear clicks in the WAV file, try a player that handles PCM correctly.
Conclusion
Morse code is a sound-based communication system that has survived from the telegraph era into modern amateur radio. The ITU-R M.1677 standard defines the code and timing rules that this tool implements. Whether you are generating practice audio, decoding a signal from your microphone, or translating written Morse code, the tool handles all three modes in the browser. For text-only Morse translation, use the Morse Code Translator. For other audio-based signaling, see Tap Code Audio. For a cipher that builds on Morse code, try the Fractionated Morse Cipher.