Text to Morse Code
Convert text to Morse code and play it as audio
关于此工具
Type any text and see it translated into Morse code dots and dashes. A visual display shows each character's pattern. Hit Play to hear the Morse code beeped through your browser using the Web Audio API at an adjustable speed (5–30 WPM). You can also download the result as a WAV audio file.
使用方法
- 1 Type or paste text into the input box.
- 2 The Morse code representation appears instantly below.
- 3 Adjust the WPM slider to set the playback speed.
- 4 Click Play to hear the Morse code through your speakers or headphones.
- 5 Click Download WAV to save the audio as a file.
How Morse code encodes letters
Morse code represents each letter, digit, and punctuation mark as a unique sequence of two signals: a short one called a dit (the dot, .) and a long one called a dah (the dash, -). The cleverness of the system is that common letters get short codes — E is a single dot, T a single dash — while rarer letters get longer ones, so typical English text stays compact. This tool maps the full alphabet (A–Z), the digits 0–9, and common punctuation such as period, comma, question mark, slash, and the at-sign. A space between words becomes a forward slash /. Any character it does not recognise is simply skipped rather than guessed at.
The four timing units that make it readable
Morse is not just dots and dashes — it is rhythm. Everything is built from one base unit, the length of a single dit, and the rest follow fixed multiples:
| Element | Length |
|---|---|
| Dot (dit) | 1 unit of sound |
| Dash (dah) | 3 units of sound |
| Gap between symbols in a letter | 1 unit of silence |
| Gap between letters | 3 units of silence |
| Gap between words | 7 units of silence |
This player implements exactly those ratios, which is why the audio sounds like real Morse rather than evenly spaced beeps. Get the gaps wrong and a listener cannot tell where one letter ends and the next begins.
What WPM means and how the speed is calculated
Speed is measured in words per minute (WPM) using the standard reference word "PARIS", which happens to be exactly 50 time units long including spacing. From that, the duration of one dit in milliseconds is simply 1200 / WPM. So at the default 15 WPM, a dit lasts 1200 ÷ 15 = 80 ms, a dash lasts 240 ms, and the gap between words is 560 ms. Drag the slider to 30 WPM and the dit halves to 40 ms; drop to 5 WPM and it stretches to 240 ms — useful when you are first learning to hear the patterns.
A worked example: encoding "SOS"
The distress signal SOS is the classic example. S is three dots, O is three dashes, so the output is ... --- .... At 15 WPM the audio plays as three 80 ms beeps (with 80 ms gaps), a 240 ms letter gap, three 240 ms beeps, another letter gap, then three more short beeps. The visual breakdown above the player shows each character with its dots drawn as small circles and dashes as longer bars, so you can match what you hear to what you see.
How the sound and the WAV file are made
Playback uses the browser's Web Audio API. The tool schedules a sine-wave oscillator for each dit and dah at a tone you choose between 300 and 1000 Hz (600 Hz by default, a comfortable pitch close to what radio operators use). Each beep gets a tiny 5 ms fade-in and fade-out so it does not produce an audible click. The Download WAV button renders the same timeline into a 44.1 kHz, 16-bit mono PCM buffer and wraps it in a standard WAV header — a real audio file you can keep, share, or import into other software. All of this happens locally in your browser; no text and no audio is uploaded.
Practical uses
- Learning to copy code by ear. Start slow, then raise the WPM as your recognition improves. Hearing real timing beats reading a chart.
- Amateur radio and emergency prep. Practise sending common abbreviations and your call sign.
- Hidden messages and puzzles. Escape rooms, geocaches, and ARGs often embed Morse in audio.
- Accessibility and signalling experiments. A flashlight or buzzer driven by the same rhythm communicates without sound.
Common mistakes
- Learning by counting dots on paper. Morse is meant to be heard as rhythm; memorising "dot-dot-dot" visually slows you down later. Use the Play button.
- Cranking the speed too high too soon. Above 20 WPM, distinct letters blur together for beginners. Build the timing into your ear first.
- Expecting unsupported characters to appear. Emoji, accented letters, and symbols outside the table are dropped silently, so check the Morse output matches your intent.
- Forgetting word gaps. Two words run together sound like one long word; the
/in the output marks where the seven-unit pause goes.
常见问题
将文本翻译为摩斯码,将摩斯码翻译回文本——支持音频播放。
通过输入点和横线或点击交互式按键按钮来解码摩尔斯电码。
媒体
使用浏览器内置的语音合成引擎将任意文本转换为语音。
Visualize text as colored bit patterns, toggle individual bits, and perform byte-level AND/OR/XOR/NOT operations.