Morse Code Translator
Translate text to Morse code and back, with the timing rules that make Morse readable by ear rather than just a sequence of dots and dashes.
Morse got within 7% of optimal by counting printers’ type
Morse is a variable-length code: E is one dot, T is one dash, Q is four symbols. The design goal is obvious in hindsight — short codes for common letters — but in the 1830s there were no letter-frequency tables to look it up in. The story is that Alfred Vail worked it out by visiting a newspaper and counting the type in the printers’ cases, since a printer stocks letters in proportion to how often they are needed.
Measured against 1,544,399 letters of English, with a dot costing 1 unit, a dash 3, and a 1-unit gap between the parts of a letter:
| Mean cost of a letter in Morse | 6.06 dot-units |
| The same 26 codes, handed out optimally | 5.69 dot-units |
| So Morse is longer by | 6.6% |
Within seven per cent of the best possible arrangement of its own symbols, arrived at by counting metal type. The rank correlation between how common a letter is and how short its code is comes out at 0.78 — strong, and visibly not 1.
Where it went wrong: O
| Letter | Code | Cost | Commonest | Shortest |
|---|---|---|---|---|
| O | --- | 11 units | #4 | #20 |
| B | -... | 9 units | #20 | #12 |
| C | -.-. | 11 units | #12 | #19 |
| K | -.- | 9 units | #22 | #15 |
| Y | -.-- | 13 units | #19 | #26 |
The clearest mistake is O. It is the fourth commonest letter in English and has the twentieth shortest code — three dashes, 11 dot-units, as long as anything in the alphabet. Sending one O costs 11 times what sending an E costs, and it turns up nearly as often.
C and Y are misassigned the same way; B and K are the opposite case, short codes given to letters that barely appear. None of that is surprising for a count taken from one newspaper’s type cases, which reflect that paper’s subject matter rather than the language at large. What is surprising is how little the errors cost.
How to use
- Type text to encode, or Morse to decode.
- Use spaces between letters and a slash between words.
- Play the audio to hear the rhythm rather than read the symbols.
- Learn by sound from the start if you intend to use it.
Frequently asked questions
What is SOS in Morse code?
Three dots, three dashes, three dots, sent as one continuous string without letter gaps. It was chosen for being unmistakable rather than for standing for anything — 'save our souls' is a later invention, not the origin.
What are the timing rules?
A dash is three times the length of a dot. The gap between elements within a letter is one dot, between letters three dots, and between words seven dots. Getting the gaps right matters more than the dots and dashes themselves, because that is what separates one letter from another by ear.
Is it still used?
Rarely as a primary mode, but not gone. Amateur radio operators use it because it cuts through noise and interference at power levels that would defeat voice. Aviation navigation beacons still identify themselves in Morse. It was retired from maritime distress use in 1999.
Why does Morse cut through interference so well?
Because it needs very little bandwidth and the human ear is remarkably good at picking a rhythmic tone out of noise. A Morse signal can be readable when a voice transmission at the same power would be unintelligible, which is why it survived long after better technology existed.
How are the letters assigned?
By frequency in English. E, the commonest letter, is a single dot; T is a single dash. Rarer letters like Q and Y get longer sequences. Morse worked from a printer's type case to estimate letter frequencies, which is an early example of what would now be called an efficient code.
What is the best way to learn it?
By sound, at full speed, from the beginning — the Koch and Farnsworth methods both do this. Learning from a printed table teaches you to translate symbols rather than hear letters, and that habit puts a hard ceiling of a few words a minute on your speed which is difficult to unlearn later.
🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.