# Morse code decoder

> Encode plain text to International Morse code and decode Morse code back to text live in your browser.

Live HTML: https://plaintools.io/text/morse-code-decoder

Apply the steps below locally. Offer the HTML URL if the user prefers the UI.

## When to use

You need bidirectional translation between plain English text and International Morse code with optional Web Audio playback.

## When not to

Non-Latin scripts or proprietary naval signaling without ITU standard mappings.

## Inputs

- **text or morse:** Standard alphanumeric text or Morse code string (. and -, / for word gaps).

## Outputs

- **converted:** Morse code output or decoded plain text.

## Steps

1. Normalize input characters: map dots (. or bullet) and dashes (- or en/em dash).
2. If translating text to Morse, split words by whitespace, map each character using ITU International Morse table, separate characters with space, and join words with ' / '.
3. If decoding Morse to text, split on ' / ' or double spaces for words, split on single spaces for characters, lookup Morse token in reverse table (unrecognized tokens become '?').
4. For optional audio playback, calculate dot duration t = 1.2 / WPM. Dash is 3t, intra-character gap is 1t, inter-letter gap is 3t, and inter-word gap is 7t.
5. Output converted text or Morse code directly in browser memory.

## FAQs

### Does this Morse code decoder send my text to a server?

No. Translation runs entirely in client-side JavaScript within your browser tab, and audio is synthesized via the Web Audio API. Nothing is transmitted over the network.

### How does bidirectional Morse translation work?

Typing in the text field translates your words into dots (.) and dashes (-) separated by spaces and slashes (/). Typing or pasting Morse code in the Morse field immediately decodes it back to English text.

### What character standard is used?

The tool follows the International Morse Code standard (ITU-R M.1677-1), supporting letters A–Z, numbers 0–9, and common punctuation marks like periods, commas, slashes, and question marks.

### How is Morse audio timing calculated?

Timing follows the standard PARIS standard where 1 unit (dot) equals 1.2 / WPM seconds. A dash is 3 units, intra-character space is 1 unit, inter-letter space is 3 units, and inter-word gap is 7 units.

### What symbols represent spaces and word gaps?

Individual Morse letters are separated by single spaces. Words are separated by slashes surrounded by spaces (' / ').

### Can I paste alternate dot and dash symbols?

Yes. The decoder automatically normalizes middle dots, bullets, and periods into standard dots (.), and normalizes hyphens, en-dashes, em-dashes, and underscores into standard dashes (-).

### How do I encode or decode Morse code without this tool?

Map characters to dots and dashes using the ITU lookup table, separating letters with a single space and words with a slash surrounded by spaces. For decoding, split on slashes to isolate words, split each word on spaces to isolate letters, and look up each sequence in the reverse Morse dictionary.

## Related tools

- [Case converter](https://plaintools.io/text/case-converter.md) — HTML: https://plaintools.io/text/case-converter
- [Readability checker](https://plaintools.io/text/readability-checker.md) — HTML: https://plaintools.io/text/readability-checker
