摩斯码翻译器
将文本翻译为摩斯码,将摩斯码翻译回文本——支持音频播放。
关于此工具
将文本转换为摩斯码的点和划,或将摩斯码解码回文本。使用Web Audio API播放摩斯码音频。支持所有26个字母、数字0-9和常见标点符号。
使用方法
- 1 输入文本以转换为摩斯码,或输入摩斯点和划以解码。
- 2 按播放以音频嘟嘟声的形式听摩斯码。
- 3 使用WPM滑块调整速度。
- 4 使用复制按钮复制结果。
How Morse code turns letters into rhythm
Morse code represents each letter, digit, and punctuation mark as a sequence of two signals: a short one (a dot or "dit") and a long one (a dash or "dah"). Devised in the 1830s for the electric telegraph, it let a single wire — capable only of being on or off — carry written language across continents. The genius of the system is its economy: the most common English letter, E, is a single dot, while rarer letters get longer patterns, so typical text sends faster. This translator converts text to Morse and Morse back to text, and can play the result as audio so you can hear the rhythm.
The timing rules that make Morse readable
Morse is not just dots and dashes — the gaps carry meaning too. The whole system is built on one unit of time, the length of a single dot. Everything else is a multiple of it:
| Element | Duration |
|---|---|
| Dot | 1 unit of sound |
| Dash | 3 units of sound |
| Gap between dots/dashes in a letter | 1 unit of silence |
| Gap between letters | 3 units of silence |
| Gap between words | 7 units of silence |
This is why a dash is exactly three times a dot, and why spacing is what separates an E E from an I. In the text output, the tool separates letters with a single space and words with a forward slash, so HELLO WORLD becomes .... . .-.. .-.. --- / .-- --- .-. .-.. -...
A worked example: SOS
Type SOS and the encoder looks up each letter in the standard table: S is ..., O is ---, S is ... again. Joined with single-space letter gaps you get ... --- .... SOS was chosen as the international distress signal not because the letters abbreviate anything, but because the pattern — three short, three long, three short — is unmistakable and easy to send even by an exhausted operator. Press Play and you hear nine tones at 700 Hz in that famous rhythm.
Encoding, decoding, and how speed is set
The decoder is the encoder run backwards: it splits your input on slashes or large gaps into words, splits each word on spaces into letters, and looks up each dot-dash group in a reversed table. Any group it does not recognize becomes a ?. The audio is generated live with the Web Audio API — there is no sound file to download. The WPM (words per minute) slider sets the speed by changing the duration of one unit; the tool computes the dot length as roughly 1.2 ÷ WPM seconds, the standard formula based on the word "PARIS" as a 50-unit reference. At 15 WPM a dot lasts about 0.08 seconds; raise the WPM and every element shrinks proportionally.
Practical use cases
- Learning Morse by ear. Hearing the rhythm at an adjustable speed is the proven way amateur radio operators build fluency — start slow and increase WPM as you improve.
- Amateur (ham) radio practice. Morse, still called CW on the air, remains in active use; the translator helps you draft and check messages.
- Puzzles and escape rooms. Encode a clue as dots and dashes, or decode one you have found.
- Accessibility and signaling. Morse can be sent with light, sound, or taps when other channels fail.
Common mistakes
- Forgetting word separators when decoding. If you paste Morse with only single spaces everywhere, the decoder cannot tell where one word ends; separate words with a slash or a clearly larger gap.
- Using unsupported characters. The table covers A–Z, 0–9, and common punctuation. Characters with no Morse equivalent are simply dropped during encoding, so check the output if something seems missing.
- Confusing letter and word gaps. The single biggest source of decoding errors is spacing; a letter gap is three units, a word gap is seven, and getting them wrong jumbles the message.
- Expecting case to survive. Morse has no upper and lower case, so the encoder treats everything as capitals.
Privacy
Translation and audio generation happen entirely in your browser. Nothing you type is sent to a server, and the tones are synthesized on your device — the tool works offline.