decoder.tools

Morse Code Decoder

Translate Morse code (dots and dashes) into letters, digits and punctuation.

INPUT
OUTPUT

The result appears here as you type.

Decoding runs in your browser. What you paste is not sent to a server.

A Morse code translator converts sequences of dots and dashes into letters. Each letter is a short pattern, such as .- for A and ... for S, separated from the next letter by a space.

Example

Input
.... . .-.. .-.. --- / .-- --- .-. .-.. -..
Output
HELLO WORLD

Put one space between letters and a / (or two or more spaces) between words.

How Morse code works

Morse code writes each character as a sequence of short signals (dots, .) and long signals (dashes, -). Common letters get short codes: E is a single dot and T a single dash. Rare letters get longer ones: Q is --.-.

When sent by sound or light, timing separates the symbols. A dash lasts three dots, the gap between letters is three dots long, and the gap between words is seven. In text form those gaps become spaces and slashes.

Morse code chart

LetterCodeLetterCodeDigitCode
A.-N-.1.----
B-...O---2..---
C-.-.P.--.3...--
D-..Q--.-4....-
E.R.-.5.....
F..-.S...6-....
G--.T-7--...
H....U..-8---..
I..V...-9----.
J.---W.--0-----
K-.-X-..-..-.-.-
L.-..Y-.--,--..--
M--Z--..?..--..

How to use the Morse translator

  1. Paste the Morse code using . and -.
  2. Separate letters with a space and words with /.
  3. Read the text. A � in the output marks a pattern that isn't a valid Morse character.

Decode Morse code in code

Python
M = {".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G",
     "....": "H", "..": "I", ".---": "J", "-.-": "K", ".-..": "L", "--": "M", "-.": "N",
     "---": "O", ".--.": "P", "--.-": "Q", ".-.": "R", "...": "S", "-": "T", "..-": "U",
     "...-": "V", ".--": "W", "-..-": "X", "-.--": "Y", "--..": "Z"}
msg = ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."
print(" ".join("".join(M[c] for c in w.split()) for w in msg.split(" / ")))  # HELLO WORLD

Morse code at a glance

StandardInternational Morse code (ITU-R M.1677-1)
SymbolsDot . and dash -
Letter separatorOne space
Word separator/ or two or more spaces
SOS... --- ...

Frequently asked questions

What is SOS in Morse code?

... --- ...: three dots, three dashes, three dots. In practice it's sent as one continuous signal with no letter gaps.

Can this tool encode text into Morse?

Not yet. It translates Morse into text. To encode, use the chart above.

My message uses 0 and 1 instead of dots and dashes. Is it Morse?

It may be, but it's more likely binary if the groups are 8 digits long. Morse groups vary in length (1 to 5 symbols for letters), while binary bytes are always 8.

Last reviewed · found a mistake? contact@decoder.tools · view as markdown