Morse Code Converter
Convert text to Morse code and decode Morse code back to text
Morse Code Converter
Convert between text and Morse code
Morse Code Reference
- A: .-
- E: .
- T: -
- S: ...
- O: ---
- Dot: 1 unit
- Dash: 3 units
- Space between symbols: 1 unit
- Space between letters: 3 units
- Space between words: 7 units
- SOS: ... --- ...
- Space: /
- Error: ........
- End of message: .-.-.
Morse Code Converter – Complete International Signaling and Telegraphy Guide
Welcome to our comprehensive online Morse Code Converter, a full-featured telecommunications toolkit engineered to translate plain alphanumeric text into International Morse Code and decode Morse signals back into clear, readable language. Whether you are studying telecommunications history, preparing for an amateur radio operator license examination, transcribing historic telegraph messages, experimenting with audio frequency keying, or building assistive communication devices, this tool delivers instant, bidirectional translation with acoustic playback and standardized delimiter formatting directly inside your web browser.
The Origins of Telegraphic Communication: From Samuel Morse to ITU-R M.1677-1
Morse code is one of the earliest digital communication systems in human history, developed during the late 1830s and 1840s by inventor Samuel F. B. Morse and mechanical engineer Alfred Vail. Before the advent of voice telephony, radio broadcasts, or optical fiber networks, electrical telegraphy transformed global civilization by enabling instantaneous long-distance information transfer along metallic wires using electrical pulses.
The first commercial telegraph message was sent in May 1844 along a line between Washington, D.C., and Baltimore, Maryland, transmitting the famous biblical phrase: "What hath God wrought". The original system, known as American Morse Code, was heavily utilized by railway dispatchers across North America. However, American Morse featured variable dash lengths and internal pauses within single letters, which made it prone to transcription errors across noisy maritime submarine cables.
To resolve these ambiguities, German telegraph engineer Friedrich Clemens Gerke substantially revised the symbol assignments in 1848, establishing what was known as the Continental Morse Code. Gerke eliminated variable spaces within characters and established uniform duration proportions. This system was subsequently standardized at the International Telegraph Conference in Paris in 1865 and is officially maintained today by the International Telecommunication Union as Recommendation ITU-R M.1677-1 (International Morse code).
The Mathematical Architecture of Morse Code: Timing and Proportions
Modern International Morse Code is governed by strict, standardized mathematical ratios. The foundational unit of time measurement is known as the dot duration (often vocalized as a "dit"). All other symbols, intervals, and pauses within the transmission stream are calculated as integer multiples of this single base unit:
- The Dot (Dit, represented as '.'): The fundamental time unit. Its length is defined as exactly 1 unit of time.
- The Dash (Dah, represented as '-'): Equal to exactly three dots in duration (3 units of time).
- Intra-Character Spacing: The silence or unkeyed interval between consecutive dots or dashes within the same character is equal to 1 dot duration (1 unit of time).
- Inter-Character Spacing: The pause between two letters within the same word is equal to 3 dot durations (3 units of time, often represented textually by a single whitespace character).
- Inter-Word Spacing: The silence between distinct words is equal to 7 dot durations (7 units of time, commonly demarcated in text by a forward slash '/' or three spaces).
Transmission Speed and the PARIS Standard:
In radiotelegraphy, transmission speed is measured in Words Per Minute (WPM). Because letters vary in duration, the international standard calibrates speed against the standard word "PARIS " (including the trailing inter-word gap). A transmission of "PARIS " comprises exactly 50 elemental dot units. Therefore, at a transmission speed of W words per minute, the duration of an individual dot is given by the formula:
Dot Duration (milliseconds) = 1200 / WPM.
For example, at a standard amateur radio speed of 20 WPM, each dot lasts precisely 60 milliseconds, a dash lasts 180 milliseconds, and the inter-word pause lasts 420 milliseconds.
Information Theory: Anticipating Huffman Coding by a Century
One of the most brilliant aspects of Alfred Vail's code design was its empirical application of what modern computer scientists call variable-length entropy encoding. More than a century before Claude Shannon published the mathematical theory of communication and David Huffman created Huffman coding in 1952, Vail recognized that communication efficiency depends on letter frequency.
Vail visited local newspaper printing offices in Morristown, New Jersey, and inventoried the quantities of movable metal type contained in printers' type cases. He observed that the letter 'E' was by far the most frequently used letter in the English language, followed closely by 'T', while letters like 'Q', 'Z', 'J', and 'X' were exceptionally rare.
Consequently, Vail assigned the simplest and shortest possible sound—a single dot (.)—to the letter 'E', and a single dash (-) to the letter 'T'. Conversely, rare characters received longer four-element sequences (such as --.- for 'Q' and --.. for 'Z'). By minimizing the average symbol length weighted by natural language frequency, Morse code drastically accelerated telegraphic throughput and conserved electrical battery power.
Comprehensive International Morse Code Reference Table
The following reference table contains the full standard mappings for English alphabet letters, Arabic numerals, and vital punctuation marks defined under ITU-R M.1677-1:
| Character | Morse Representation | Phonetic Rhythm | Character | Morse Representation | Phonetic Rhythm |
|---|---|---|---|---|---|
| A | .- | di-dah | N | -. | dah-dit |
| B | -... | dah-di-di-dit | O | --- | dah-dah-dah |
| C | -.-. | dah-di-dah-dit | P | .--. | di-dah-dah-dit |
| D | -.. | dah-di-dit | Q | --.- | dah-dah-di-dah |
| E | . | dit | R | .-. | di-dah-dit |
| F | ..-. | di-di-dah-dit | S | ... | di-di-dit |
| G | --. | dah-dah-dit | T | - | dah |
| H | .... | di-di-di-dit | U | ..- | di-di-dah |
| I | .. | di-dit | V | ...- | di-di-di-dah |
| J | .--- | di-dah-dah-dah | W | .-- | di-dah-dah |
| K | -.- | dah-di-dah | X | -..- | dah-di-di-dah |
| L | .-.. | di-dah-di-dit | Y | -.-- | dah-di-dah-dah |
| M | -- | dah-dah | Z | --.. | dah-dah-di-dit |
Numeric Sequences (The Five-Element Sliding Window)
Numerals in Morse code possess an exceptionally symmetrical, five-element pattern. Digits 1 through 5 begin with dots and transition progressively into dashes, while digits 6 through 0 begin with dashes and transition into dots:
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
|---|---|---|---|---|---|---|---|---|---|
| .---- | ..--- | ...-- | ....- | ..... | -.... | --... | ---.. | ----. | ----- |
Crucial Punctuation and Procedural Signals (Prosigns)
Telegraphic communication relies heavily on specialized punctuation marks and procedural signs (prosigns) transmitted without intra-character spacing:
- Period / Full Stop ( . ):
.-.-.-(six elements) - Comma ( , ):
--..--(six elements) - Question Mark ( ? ):
..--..(six elements) - Slash / Fraction Bar ( / ):
-..-.(five elements) - SOS Distress Prosign:
...---...(transmitted as one continuous 9-element sound stream without letter pauses, signifying extreme maritime emergency) - CQ General Call:
-.-. --.-(calling any receiving station on the frequency) - End of Transmission (AR):
.-.-.(indicates the completion of a telegram or message)
Programmatic Implementations in Modern Codebases
Encoding and decoding Morse code programmatically requires handling delimiter hierarchies: letters separated by single spaces and words separated by slashes or triple spaces.
JavaScript Implementation
The following JavaScript implementation demonstrates modular encoding and decoding using dictionary lookups and array transforms:
const MORSE_MAP = {
'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': '--..', '1': '.----', '2': '..---', '3': '...--',
'4': '....-', '5': '.....', '6': '-....', '7': '--...',
'8': '---..', '9': '----.', '0': '-----', ' ': '/'
};
// Invert map for decoding
const REVERSE_MAP = {};
Object.keys(MORSE_MAP).forEach(function(key) {
REVERSE_MAP[MORSE_MAP[key]] = key;
});
function textToMorse(text) {
return text.toUpperCase().split('').map(function(ch) {
return MORSE_MAP[ch] || '';
}).filter(Boolean).join(' ');
}
function morseToText(morse) {
return morse.trim().split(/\s{3,}|\s*\/\s*/).map(function(word) {
return word.split(' ').map(function(code) {
return REVERSE_MAP[code] || '';
}).join('');
}).join(' ');
}Python Implementation
In Python, clean dictionary mappings provide high-throughput translation capabilities:
MORSE_CODE_DICT = {
'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': '--..', '0': '-----', '1': '.----', '2': '..---',
'3': '...--', '4': '....-', '5': '.....', '6': '-....',
'7': '--...', '8': '---..', '9': '----.'
}
REVERSE_DICT = {val: key for key, val in MORSE_CODE_DICT.items()}
REVERSE_DICT['/'] = ' '
def encode_morse(message):
encoded = []
for word in message.upper().split(' '):
encoded_word = " ".join([MORSE_CODE_DICT.get(c, '') for c in word])
encoded.append(encoded_word)
return " / ".join(encoded)
def decode_morse(message):
decoded = []
for word in message.strip().split(' / '):
decoded_word = "".join([REVERSE_DICT.get(code, '') for code in word.split(' ')])
decoded.append(decoded_word)
return " ".join(decoded)Modern Operational Applications: Where Morse Code Thrives Today
Although commercial telegraph lines and traditional maritime Morse distress frequencies were superseded by satellite systems like GMDSS (Global Maritime Distress and Safety System) in 1999, Morse code remains vibrant and indispensable across several specialized fields:
- Aviation Radio Navigation (VOR and NDB Beacons): Terrestrial radio navigation aids such as VOR (VHF Omnidirectional Range), ILS (Instrument Landing System), and NDB (Non-Directional Beacon) continuously broadcast their three-letter airport identifiers in audible Morse code over radio frequencies. Pilots listen to these transmissions to positively confirm navigation beacon tuning before instrument approaches.
- Amateur (Ham) Radio Telegraphy (CW Mode): Thousands of amateur radio enthusiasts worldwide communicate daily via Continuous Wave (CW) radiotelegraphy. A pure unmodulated carrier wave keyed by Morse code occupies a tiny bandwidth (less than 150 Hz compared to 3,000 Hz for voice SSB) and possesses extraordinary signal-to-noise penetration. During severe solar storms or geomagnetic disturbances, a 5-watt Morse signal can traverse thousands of miles across oceans when voice communication is completely blocked.
- Assistive Technology and Accessibility: For individuals with severe physical disabilities, ALS (Amyotrophic Lateral Sclerosis), cerebral palsy, or locked-in syndrome, specialized sip-and-puff switches or single-muscle eye-blink sensors allow users to generate dits and dahs, translating physical micro-movements into synthesized speech and digital text.
- Emergency Signaling and Survival: When electrical devices fail, Morse code can be transmitted using simple optical or acoustic tools—such as flashing a mirror in sunlight, signaling with an Aldis lamp, pulsing a flashlight beam, or tapping on a hollow metal pipe.
How to Use Our Interactive Morse Code Converter
Our web application provides an intuitive, high-performance interface for all your telegraphic translation needs:
- Type or Paste Freely: Enter plain English text in the source area to generate formatted dots and dashes instantly, or paste raw Morse strings containing dots, dashes, and slashes to decode back to plain text.
- Delimiters Handled Automatically: Our engine correctly detects and handles both single space letter separation and slash '/' or multi-space word separation.
- Instant Clipboard Access: Use the one-click copy button to immediately export your translated code into documents, programming scripts, or educational assignments.
Zero-Knowledge Client-Side Architecture and Privacy
Your data security and personal privacy are guaranteed. All Morse code conversions and parsing algorithms execute 100% locally within your client browser using vanilla JavaScript. No text inputs, decoded messages, or telemetry packets are ever transmitted across the internet to our servers. The entire tool functions flawlessly even when your device is completely disconnected from the network, providing an entirely secure, private, and air-gapped conversion environment.
Frequently Asked Questions (FAQs)
Explore Related Tools
Hand-picked utilities and calculators related to this tool.
