Morse Code Encoder Decoder

Convert text to Morse code or decode Morse to readable text. Supports letters, digits, and standard prosigns.

Back to all tools on ToolForge

More in Encoding & Decoding

Text Input



Morse Code Output

Use space between letters, / between words



About Morse Code

Morse code is a character encoding scheme that represents letters and numerals as sequences of two signal durations: dots (short pulses) and dashes (long pulses). Originally developed for telegraphy, it remains in use for amateur radio, aviation navigation, and emergency signaling.

Morse Code Timing Standards

Morse code uses a precise timing system based on the dot duration as the fundamental unit:

Element Duration Description
Dot (dit) 1 unit Basic time unit, short pulse
Dash (dah) 3 units Three times dot duration
Intra-letter space 1 unit Gap between dots/dashes within a letter
Inter-letter space 3 units Gap between letters (represented as space)
Inter-word space 7 units Gap between words (represented as /)

Complete Morse Code Character Reference

Letter Code Letter Code
A.-N-.
B-...O---
C-.-.P.--.
D-..Q--.-
E.R.-.
F..-.S...
G--.T-
H....U..-
I..V...-
J.---W.--
K-.-X-..-
L.-..Y-.--
M--Z--..

Morse Code Numerals

Digit Code Pattern
1.----1 dot, 4 dashes
2..---2 dots, 3 dashes
3...--3 dots, 2 dashes
4....-4 dots, 1 dash
5.....5 dots
6-....1 dash, 4 dots
7--...2 dashes, 3 dots
8---..3 dashes, 2 dots
9----.4 dashes, 1 dot
0-----5 dashes

Common Prosigns and Abbreviations

Prosign Code Meaning
SOS...---...Distress signal (save our souls)
CQ-.-. --.-Calling any station
DE-.. .From (this is)
K-.-Invitation to transmit
KN-. --Listening only for specific station
SK...-.-End of contact (silent key)
AR.-.-.End of message
BT-...-Separator (break)
R.-.Received (roger)
73--... ...--Best regards

Encoding and Decoding Algorithm

JavaScript Morse Code Implementation:

// Character mapping table
const MORSE_CODE = {
  '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': '-----'
};

// Create reverse mapping for decoding
const REVERSE_CODE = Object.fromEntries(
  Object.entries(MORSE_CODE).map(([k, v]) => [v, k])
);

// Encode text to Morse code
function encodeToMorse(text) {
  return text.toUpperCase()
    .replace(/[^A-Z0-9\s]/g, '')  // Remove non-alphanumeric
    .split('')
    .map(char => {
      if (char === ' ') return '/';  // Word separator
      return MORSE_CODE[char] || '';
    })
    .join(' ')
    .replace(/\s*\/\s*/g, ' / ');  // Clean word separators
}

// Decode Morse code to text
function decodeMorse(morse) {
  return morse.trim()
    .split(/\s+/)  // Split on whitespace
    .map(symbol => {
      if (symbol === '/') return ' ';  // Word separator
      return REVERSE_CODE[symbol] || '';
    })
    .join('');
}

// Usage examples:
encodeToMorse('HELLO');      // ".... . .-.. .-.. ---"
encodeToMorse('HELLO WORLD'); // ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."
decodeMorse('.... . .-.. .-.. ---');  // "HELLO"
decodeMorse('... --- ...');           // "SOS"

Speed and Timing Calculation

Morse code speed is measured in words per minute (WPM), using the standard word "PARIS" as reference:

Speed (WPM) Dot Duration (ms) Dash Duration (ms) Skill Level
5 WPM240 ms720 msBeginner
10 WPM120 ms360 msNovice
15 WPM80 ms240 msIntermediate
20 WPM60 ms180 msAdvanced
25 WPM48 ms144 msExpert
30 WPM40 ms120 msProfessional

The word "PARIS" contains exactly 50 dot/dash elements (including intra-letter spaces). At 20 WPM, one minute contains 20 × 50 = 1000 elements, so each element is 60000/1000 = 60ms.

Special Characters and Extensions

Character Code Mnemonic
@.- -.-.A + C (at sign)
&.- ...A + S (AS)
=-...-BT (break)
/-..-.DN (double dash)
+.-.-.AR (end of message)
?..--..IM (interrogation)
!--..--DN (emphasized)
:---...OM (colon)

Common Use Cases

Morse Code Transmission Methods

Method Medium Use Case
Audio ToneSound wavesRadio, telephone, audible signals
Light FlashVisible lightSignal lamps, flashlight, heliograph
Radio CWRF carrierAmateur radio, maritime communication
ElectricalWire circuitTelegraph, submarine cable
TactileVibrationAccessibility devices

How to Use Morse Code Tool

  1. Enter text: Type or paste text to encode in the Text field.
  2. Click Encode: Convert text to Morse code with proper spacing.
  3. Or decode: Paste Morse code (spaces between letters, / between words) and click Decode.
  4. Copy result: Use the Copy buttons to copy the converted output.

Tips

Frequently Asked Questions

How does Morse code timing work?
Morse code uses precise timing: a dot (.) is one unit, a dash (-) is three units, the space between parts of the same letter is one unit, between letters is three units, and between words is seven units. This timing system allows operators to distinguish between letters and words even at high speeds.
What are the standard Morse code abbreviations?
Common Morse abbreviations include: CQ (calling any station), DE (from), K (invitation to transmit), KN (listening only for specific station), SK (end of contact), BT (separator), AR (end of message), and R (received). These prosigns streamline communication.
How do you represent special characters in Morse?
Special characters use specific patterns: @ is AC (.- -.-.), & is AS (.- ...), = is BT (-...-), / is DN (-..-.), + is AR (.-.-.), and ? is IM (..--..). Some modern additions exist for email and web symbols.
What is the difference between dots and dashes?
Dots (dits) are short signals lasting one time unit. Dashes (dahs) are long signals lasting three time units. The rhythm and timing between them encode information. Letter frequency influenced assignment: E (most common) is a single dot, T is a single dash.
How fast should Morse code be sent?
Beginner speeds are 5-10 WPM (words per minute). Intermediate operators use 15-20 WPM. Expert operators can send 25-30+ WPM. Speed is measured by the word PARIS, which contains 50 dot/dash elements. At 20 WPM, each dot is 0.06 seconds.
What are prosigns in Morse code?
Prosigns are procedural signals that convey standard operational messages. Examples: SOS (...---...) for distress, CQ (calling any station), DE (this is), SK (end of work), AR (end of message). They are transmitted as continuous sequences without inter-letter gaps.