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
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 WPM | 240 ms | 720 ms | Beginner |
| 10 WPM | 120 ms | 360 ms | Novice |
| 15 WPM | 80 ms | 240 ms | Intermediate |
| 20 WPM | 60 ms | 180 ms | Advanced |
| 25 WPM | 48 ms | 144 ms | Expert |
| 30 WPM | 40 ms | 120 ms | Professional |
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
- Amateur Radio: CW (continuous wave) communication between ham radio operators worldwide
- Aviation: VOR navigation beacons and NDB stations transmit identifiers in Morse
- Emergency Signaling: SOS and other distress signals using light, sound, or radio
- Education: Teaching encoding/decoding concepts and digital communication fundamentals
- Accessibility: Assistive communication for people with limited motor control
- Historical Research: Decoding historical telegraph and radio messages
Morse Code Transmission Methods
| Method | Medium | Use Case |
|---|---|---|
| Audio Tone | Sound waves | Radio, telephone, audible signals |
| Light Flash | Visible light | Signal lamps, flashlight, heliograph |
| Radio CW | RF carrier | Amateur radio, maritime communication |
| Electrical | Wire circuit | Telegraph, submarine cable |
| Tactile | Vibration | Accessibility devices |
How to Use Morse Code Tool
- Enter text: Type or paste text to encode in the Text field.
- Click Encode: Convert text to Morse code with proper spacing.
- Or decode: Paste Morse code (spaces between letters, / between words) and click Decode.
- Copy result: Use the Copy buttons to copy the converted output.
Tips
- Use / to separate words in Morse input (optional - spaces also work)
- Lowercase letters are automatically converted to uppercase
- Numbers are preserved in conversion
- Special characters are removed during encoding
- Invalid Morse sequences are silently skipped during decoding
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.