Morse Code Guide
What Is Morse Code?
Morse code is a signal code that alternates between on and off states, using different combinations to represent different English letters, numbers, and punctuation marks. It was invented by American Samuel Morse in 1836 and was originally used for telegraph communication. Morse code consists of two basic signals: short signal "dit" (Dot, .) and long signal "dah" (Dash, -), where the long signal duration is three times that of the short signal.
The encoding design of Morse code is very clever - commonly used letters are assigned shorter codes. For example, the letter E has only one dot (.), T has only one dash (-), while less commonly used letters like Q have four symbols (- - . -). This design significantly improves communication efficiency. The interval between letters is three dots duration, and the interval between words is seven dots duration.
Encoding Reference Table
// Morse code reference table (JavaScript object)
const morseCode = {
'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': '----.'
};
// Text to Morse code
function textToMorse(text) {
return text.toUpperCase()
.split('')
.map(char => morseCode[char] || char)
.join(' ');
}
// Morse code to text
function morseToText(morse) {
const reverseMorse = Object.fromEntries(
Object.entries(morseCode).map(([k, v]) => [v, k])
);
return morse
.split(' ')
.map(code => reverseMorse[code] || code)
.join('');
}
console.log(textToMorse('SOS')); // '... --- ...'
Modern Applications and Learning Methods
Although Morse code is no longer the mainstream communication method, it still has various modern applications. In emergency rescue, Morse code SOS (... --- ...) remains the international distress signal. In accessibility, Morse code is used to help people with physical disabilities input text through switches. The best way to learn Morse code is group memorization - grouping letters by similarity, then combining auditory and visual training.
Recommended Tools
Morse Code Translator is an online Morse code translation tool. Morse Mania is a Morse code learning app providing gamified learning experience. LCWO.net is an online Morse code practice platform supporting speed adjustment. G4ILO provides Morse code decoder functionality.