HandyTools Hub

Morse Code Converter

Convert text to Morse code and decode Morse code back to text

0 chars
0 chars

Morse code turns text into the dots and dashes that once carried messages across telegraph wires and radio waves. This converter encodes plain English into International Morse Code and decodes it back, with an audio mode so you can hear the rhythm of a message. It is built for learners, amateur radio operators, and puzzle designers.

The Timing Behind the Dots and Dashes

Morse is not an arbitrary substitution cipher — the timing is the code. The standard unit is the length of one dot. A dash lasts three units, the gap between signals inside a character is one unit, the gap between characters is three units, and the gap between words is seven units.

The audio playback follows the same 1:3 ratio in miniature: each dot is an 80 ms tone and each dash is 240 ms, all at 700 Hz. Separators add 160 ms of silence. That ratio is why an experienced listener can copy a message without counting — the ear hears “short” and “long,” not individual units.

ElementReal MorseThis tool’s audio
Dot (dit)1 unit80 ms
Dash (dah)3 units240 ms
Gap inside a character1 unit80 ms
Gap at a separator3 units160 ms

How to Use

  1. Choose a mode. Encode converts text to Morse; Decode converts dots and dashes back to text.
  2. Enter your input. Type text in encode mode, or paste a Morse string in decode mode. Unsupported characters become ?.
  3. Pick separators. The letter separator can be a space, a slash, or a pipe. The word separator can be /, |, or three spaces.
  4. Copy or listen. In encode mode, press Play Audio to hear the message. The character counts under each box update as you type.

A Worked Example: “SOS 2026”

Take the input SOS 2026. The tool uppercases it and splits on the single space, giving two words.

  • SOS → ... --- ...
  • 2026 → ..--- ----- ..--- -....

With the default letter separator (a space) and the default word separator (/), the output is:

... --- ... / ..--- ----- ..--- -....

Every letter is three signals or fewer: S is ..., O is ---. The digits are all five signals, which is why numbers take noticeably longer to send than letters. If you switch the letter separator to / and the word separator to |, the same message becomes .../---/... | ..---/-----/..---/-.....

Decoding and Separator Gotchas

The decoder is the strict inverse of the encoder, and that strictness is the most common source of confusion.

  • It splits the input on the exact word separator string currently selected. The default is / with a space on each side, so a pasted .../..--- with no spaces will not split into words.
  • It then splits each word on the selected letter separator. If your letters are separated by pipes but the dropdown is on space, the whole word is treated as one unknown code and returns a string of question marks.
  • Leading and trailing whitespace is trimmed, and empty segments are filtered out, so accidental double spaces usually do no harm.

The practical rule: decode with the same separators that were used to encode.

Why Punctuation Returns a Question Mark

The mapping covers A–Z and 0–9 only. Periods, commas, apostrophes, question marks, and the extended Morse punctuation codes such as .-.-.- for a full stop are not implemented. Any character outside the set is replaced with ? during encoding, and any unrecognized code is replaced with ? during decoding. This is deliberate: the tool stays small and predictable, but it means real messages with punctuation need hand editing. Amateur radio operators should be aware that standard CW abbreviations and prosigns are likewise outside this mapping.

Listening to the Output

Playback reads the encoded output string, treating . as a dot, - as a dash, and spaces or slashes as pauses. Because it is driven by the output text, changing the letter separator changes the rhythm slightly — a slash separator produces the same 160 ms pause as a space. Press Play after the output settles; the button shows a playing state and returns to normal when the sequence ends. Everything is generated in the browser with no network requests, so nothing you type leaves the page.

Quick Reference: Letters and Digits

The mapping is fixed and case-insensitive. These are all the sequences the tool knows:

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

Anything not listed here — a period, a comma, an apostrophe, a hyphen used as punctuation — is outside the table and comes back as ?.

Frequently Asked Questions

Which punctuation marks are supported?

Only the 26 letters A–Z and the ten digits 0–9 are supported. Punctuation such as periods, commas, question marks, and the official Morse punctuation codes are not in the mapping, so any unsupported character is replaced with a question mark (?). If you need the punctuation codes, encode the text by hand or use a tool that includes the full extended table.

Why does feeding my encoded output back in fail to decode?

Decode uses the separator settings currently selected, and it looks for the exact separator strings. The word separator options include surrounding spaces (for example ` / `), so a Morse string pasted as `... --- .../..---` with no spaces around the slash will not split into words correctly. Set the letter and word separators to match the encoding before decoding, or re-select them.

What do the dots and dashes actually sound like?

Playback renders each dot as an 80 ms tone and each dash as a 240 ms tone at 700 Hz, so a dash is exactly three times the length of a dot. Gaps are 80 ms between signals inside a character and 160 ms at separators. This matches the standard 1:3 ratio and makes the rhythm recognizable, though it is a demonstration tempo rather than the 20 words-per-minute used in amateur radio contacts.

Are lowercase letters handled?

Yes. Input is converted to uppercase before encoding, so `hello` and `HELLO` produce the same result. The reverse map only contains uppercase letters, and decoding always returns uppercase text.

What happens to spaces and line breaks in my text?

Words are split on single spaces, so extra spaces can create empty segments that are skipped rather than producing stray separators. Line breaks are not treated as word breaks, so a multi-line input becomes one continuous Morse string. Add explicit spaces if you want word boundaries preserved.

Is the audio available while decoding?

No. The Play Audio button appears only in encode mode, because playback reads the generated Morse output character by character. In decode mode the output is plain text, so there is nothing to play. To hear a message, encode it first, then press Play.

Reviewed by the HandyTools Hub team · Last updated