Morse Code Translator
Text to Morse and back, with the timing that makes it readable: a dash is three units, and one unit at 20 words a minute is 60 milliseconds.
... --- ... / .... . .-.. .--.
Characters in 8
Dots and dashes 22
Unit length 60.0 ms at 20 wpm
Length in units 71
Time to send 4.3 seconds
Timing, in units
dot 1
dash 3
gap inside a character 1
gap between characters 3
gap between words 7
one unit at this speed 60.0 ms
Morse is defined in units of time rather than in symbols. A dash is
three units, the gap inside a character is one, between characters three
and between words seven. At 20 words a minute a unit is 60.0
milliseconds, from the standard definition that the word PARIS is
exactly 50 units.
Those proportions are what make it readable. Code sent with even gaps is
a string of symbols an operator cannot parse; the rhythm carries the
character boundaries, which is why it can be read by ear at forty words
a minute.
SOS is one character, not three. It is sent as nine elements with no
gaps in it, `...---...`, which is why it has no full stops in the
written form and why it is not an abbreviation for "save our souls" or
anything else: it was chosen because it is unmistakable.
The international alphabet here is the ITU one. American Morse, used on
landline telegraphs, is a different code with internal gaps and it is
not compatible. Accented letters have their own codes in several
national variants, which is why an unsupported character is listed
rather than guessed at.
Morse is not obsolete. Aviation and marine navigation beacons still
identify themselves in it, amateur radio still uses it because it gets
through when voice does not, and it survives as an accessibility input
method for people who can operate one switch.
Output is valid and updates as you type.
Fix the highlighted fields to update the output.
Morse is not an alphabet of dots and dashes. It is an alphabet of durations, and the durations are the whole code: a dash is three times a dot, the gap inside a character is one dot, between characters three, and between words seven.
That is why a translator that hands back ...---... and stops has given you half the answer. An
operator reading by ear is reading the rhythm, not the symbols, and code sent with even gaps is
unreadable no matter how correct the letters are. So this prints the timing as well: how many
units the message is, and what a unit is in milliseconds at the speed you choose.
How to use
- Pick encode or decode.
- Type the text, or paste the Morse with a space between characters and a slash between words.
- Set the speed if you are going to send it. 20 words a minute is the traditional reference.
Example
SOS help at 20 words a minute:
... --- ... / .... . .-.. .--.
Characters in 8
Dots and dashes 22
Unit length 60.0 ms at 20 wpm
Length in units 72
Time to send 4.3 seconds
The unit length is not arbitrary. Speed is defined by the word PARIS, which is exactly 50 units including its trailing word gap, so a unit is 1200 / wpm milliseconds: 60 ms at 20 words a minute, 240 ms at 5. Five repetitions of PARIS come out at 14.58 seconds rather than a round 15, because the last word gap is never sent.
Pitfalls
SOS is one character, not three. It is sent as nine elements with no gaps in it, which is why
the written form has no spaces and no full stops, and why it is not an abbreviation for anything.
It was chosen because it is unmistakable. Sending ... --- ... with proper character gaps is
technically the letters S, O and S, and it is not the distress signal.
Even gaps make it unreadable. The most common mistake in code that flashes an LED or plays a tone is treating the character gap and the word gap as the same pause, or leaving out the intra-character gap entirely. The rhythm is what carries the character boundaries.
The international alphabet is not the only one. American Morse, used on landline telegraphs, has internal gaps inside some characters and is a different code. Accented letters have their own assignments in several national variants, so a character with no international code is listed here rather than guessed at.
Decoding needs the gaps you did not type. ..... is the digit 5. . . . . . is five letter
Es. Without spacing there is no way to tell, and a decoder that guesses is inventing.
Case is meaningless. Morse has no upper and lower case, so decoding always comes back in lower case. Anything that returns capitals has decided for you.
Punctuation is real but limited. The full stop, comma, question mark, apostrophe, slash, brackets, colon, semicolon, equals, plus, hyphen, underscore, quote, dollar and at sign all have codes. The at sign is the newest, added in 2004, and it is the only addition to the alphabet in living memory.
Compatibility
Everything runs in the browser: nothing is uploaded and nothing is stored.
The alphabet is the ITU-R M.1677-1 international code. The timing is the standard ratio, and the speed conversion uses the PARIS definition that both the ITU and the ARRL use, so a unit is 1200 / wpm milliseconds exactly.
Round-tripping is checked in the test suite across every character in the alphabet: encode the whole thing, decode it, and you get the same string back in lower case. PARIS is checked at 43 units, which is the standard 50 less the word gap that is not sent at the end of a message.
Prosigns are recognised on the way in and written as <SOS>, <AR>, <SK> and so on, because
they are single characters with no gaps and there is no letter sequence that corresponds to them.
Frequently asked questions
What speed should I learn at?
Can I send Morse with a flashlight?
Is Morse still used?
Why does my message look different from another translator?
/, some use a double space, and some use nothing at all,
which makes the output ambiguous. This accepts /, | and runs of spaces on the way in, and
writes / on the way out.