DevToolsmith

Morse Code Translator

Translate text to Morse code and Morse code back to text, and listen to it as audio. Dots and dashes can be written as . - or • —, with letters separated by spaces and words by a slash. Includes the full international Morse chart.

Runs 100% in your browser — nothing is uploaded

Input
Tip: drop a file here18 chars · 18 bytes · 1 line
Output
65 chars · 65 bytes · 1 line
Morse code chart
0 -----1 .----2 ..---3 ...--4 ....-5 .....6 -....7 --...8 ---..9 ----.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 --... .-.-.-, --..--? ..--..' .----.! -.-.--/ -..-.( -.--.) -.--.-& .-...: ---...; -.-.-.= -...-+ .-.-.- -....-_ ..--.-" .-..-.$ ...-..-@ .--.-.

Common phrases

TextMorse code
SOS ... --- ...
Hello world .... . .-.. .-.. --- / .-- --- .-. .-.. -..
CQ DX -.-. --.- / -.. -..-
73 --... ...--

CQ is the general call in amateur radio (“calling anyone”), DX means long distance, and 73 means “best regards”.

Morse code in code

Python
MORSE = {"A": ".-", "B": "-...", "C": "-.-.", "S": "...", "O": "---"}  # …and the rest
REVERSE = {v: k for k, v in MORSE.items()}

def to_morse(text):
    return " / ".join(" ".join(MORSE[c] for c in word if c in MORSE) for word in text.upper().split())

def from_morse(code):
    return " ".join("".join(REVERSE.get(s, "#") for s in word.split()) for word in code.split(" / "))

Looking for other old-school encodings? Try text to binary or the ROT13 and Caesar cipher.

Frequently asked questions

How is Morse code written down?

Each letter is a sequence of short signals (dots, written .) and long signals (dashes, written -). In text, letters are separated by a space and words by a slash or several spaces: “HI MOM” is .... .. / -- --- --. The translator accepts dots and dashes in other styles too, like • and —.

What is the timing of Morse code?

Everything is measured in units: a dot is 1 unit and a dash 3, the gap inside a letter is 1 unit, between letters 3 and between words 7. At 20 words per minute a unit is 60 milliseconds. The Play button plays the code as a 600 Hz tone at 18 words per minute.

Is SOS three letters?

Officially SOS is a single signal, ...---..., sent without the gaps between letters, but it’s usually written as the letters S O S (... --- ...), and that’s what the translator produces. Either form is recognised as the distress signal.

Which characters are supported?

The 26 letters, the digits 0–9 and the punctuation in the ITU standard (. , ? ' ! / ( ) & : ; = + - _ " $ @). Accented letters are written as their base letter, so é becomes E. Characters without Morse code, such as emoji, are skipped and listed under the tool. When decoding, unknown sequences are shown as #.