Morse Code Converter

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

Morse Code Converter

Convert between text and Morse code

Letters separated by space, words by /
Characters: 0 • Uppercase conversion automatic
Morse Code Reference
Common Letters:
  • A: .-
  • E: .
  • T: -
  • S: ...
  • O: ---
Timing:
  • Dot: 1 unit
  • Dash: 3 units
  • Space between symbols: 1 unit
  • Space between letters: 3 units
  • Space between words: 7 units
Special:
  • 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:

CharacterMorse RepresentationPhonetic RhythmCharacterMorse RepresentationPhonetic Rhythm
A.-di-dahN-.dah-dit
B-...dah-di-di-ditO---dah-dah-dah
C-.-.dah-di-dah-ditP.--.di-dah-dah-dit
D-..dah-di-ditQ--.-dah-dah-di-dah
E.ditR.-.di-dah-dit
F..-.di-di-dah-ditS...di-di-dit
G--.dah-dah-ditT-dah
H....di-di-di-ditU..-di-di-dah
I..di-ditV...-di-di-di-dah
J.---di-dah-dah-dahW.--di-dah-dah
K-.-dah-di-dahX-..-dah-di-di-dah
L.-..di-dah-di-ditY-.--dah-di-dah-dah
M--dah-dahZ--..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:

1234567890
.----..---...--....-.....-....--...---..----.-----

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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)

Morse code is a method of encoding text characters as sequences of two different signal durations, called dots and dashes (or dits and dahs). It was developed by Samuel Morse and Alfred Vail in the 1830s for telegraphy and is still used today in radio communications.

Morse code represents each letter, digit, and punctuation mark with a unique sequence of dots (short signals) and dashes (long signals). A dot duration is one unit, a dash is three units. Spaces between symbols are one unit, between letters three units, and between words seven units.

The most common letters have the shortest codes: E (.), T (-), A (.-), I (..), N (-.), M (--), S (...), O (---), etc. The least common letters have longer codes: Q (--.-), Y (-.--), X (-..-), J (.---), etc.

SOS is the international distress signal in Morse code: ... --- ... (three dots, three dashes, three dots). It was chosen because it's easy to remember and recognize. Contrary to popular belief, SOS doesn't stand for 'Save Our Souls' - it was simply chosen for its distinctive pattern.

Yes, Morse code has representations for all digits (0-9) and common punctuation marks. Numbers are five symbols each (0: -----, 1: .----, etc.). Common punctuation includes period (.-.-.-), comma (--..--), question mark (..--..), and slash (-..-.).

Our converter supports: 1) Spaced format (.... . .-.. .-.. ---), 2) Compact format (.....-...-..---), 3) Slash-separated words (.... . .-.. .-.. --- / .-- --- .-. .-.. -..). You can choose your preferred format for encoding.

Yes, our converter includes a sound playback feature. You can hear the Morse code representation of your text with proper timing. The sound uses standard frequencies and timing for dots (short beep) and dashes (long beep).

The conversion is 100% accurate according to the International Morse Code standard. It handles all letters A-Z, digits 0-9, common punctuation, and special symbols. The tool also validates Morse code input when decoding.

Our current tool converts between text and visual Morse code symbols. For decoding from audio, you would need specialized audio processing tools. However, you can use our decoder to convert written Morse code (dots and dashes) back to text.

Modern uses include: 1) Amateur radio communications, 2) Aviation and maritime distress signals, 3) Accessibility tools for people with disabilities, 4) Military communications, 5) Emergency signaling, 6) Educational purposes, 7) Puzzles and games.

Explore Related Tools

Hand-picked utilities and calculators related to this tool.

Binary Converter Tools