工具 指南
Text 免费 无需注册

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. 1 Type or paste text into the input box.
  2. 2 The Morse code representation appears instantly below.
  3. 3 Adjust the WPM slider to set the playback speed.
  4. 4 Click Play to hear the Morse code through your speakers or headphones.
  5. 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:

ElementLength
Dot (dit)1 unit of sound
Dash (dah)3 units of sound
Gap between symbols in a letter1 unit of silence
Gap between letters3 units of silence
Gap between words7 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.

常见问题

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}