What it does
Morse code represents letters, numbers, and punctuation as sequences of short and long signals — traditionally called dots (.) and dashes (-). This tool converts plain text into Morse code, and Morse code back into plain text, entirely in your browser. You can also play the encoded message as audible beeps, just like a real telegraph operator would hear.
Try it
How it works
- Encoding: each character of the input text is looked up in the International Morse Code table and replaced by its dot/dash sequence. Letters within a word are separated by a single space, and words are separated by a slash (
/). - Decoding: the Morse input is split on
/to find word boundaries, then each space-separated token is looked up in the reverse table to recover the original letter. - Playback: dots and dashes are converted into short and long tone bursts using the Web Audio API (
OscillatorNode), timed according to standard Morse timing rules:
- A dot lasts one unit.
- A dash lasts three units.
- The gap between symbols within a letter is one unit.
- The gap between letters is three units.
- The gap between words is seven units.
- The unit length is derived from the chosen words per minute (WPM), using the standard
PARIStiming reference:unit (ms) = 1200 / WPM.
Reference table
| Character | Morse | Character | Morse |
|---|---|---|---|
| A | .- | 0 | ----- |
| B | -... | 1 | .---- |
| C | -.-. | 2 | ..--- |
| D | -.. | 3 | ...-- |
| E | . | 4 | ....- |
| F | ..-. | 5 | ..... |
| G | --. | 6 | -.... |
| H | .... | 7 | --... |
| I | .. | 8 | ---.. |
| J | .--- | 9 | ----. |
| K | -.- | . | .-.-.- |
| L | .-.. | , | --..-- |
| M | -- | ? | ..--.. |
| N | -. | ' | .----. |
| O | --- | ! | -.-.-- |
| P | .--. | / | -..-. |
| Q | --.- | ( | -.--. |
| R | .-. | ) | -.--.- |
| S | ... | & | .-... |
| T | - | : | ---... |
| U | ..- | ; | -.-.-. |
| V | ...- | = | -...- |
| W | .-- | + | .-.-. |
| X | -..- | - | -....- |
| Y | -.-- | _ | ..--.- |
| Z | --.. | " | .-..-. |
Notes
- Unrecognized characters are skipped during encoding (with a warning shown in the status line) and unknown Morse tokens become
?during decoding. - Everything — encoding, decoding, and the audio playback — runs entirely in your browser via JavaScript and the Web Audio API. No data is ever sent anywhere.
- Playback requires a modern browser with Web Audio API support (all current major browsers qualify).