Morse code encoding transforms letters, numbers, and punctuation into sequences of dots (.) and dashes (-) following the international Morse code standard. Each character maps to a unique pattern: 'A' becomes '.-', 'B' becomes '-...', 'SOS' becomes '... --- ...'. The encoder separates individual letters with spaces and uses forward slashes (/) or multiple spaces to indicate word boundaries, producing output like '.... . .-.. .-.. --- / .-- --- .-. .-.. -..' for 'HELLO WORLD'. This standardized encoding has been used since the 19th century for telegraphy and remains essential for amateur radio communication.
Morse code is a variable-length encoding system designed for efficiency. Common letters (E = '.', T = '-', A = '.-') use short patterns, while rare letters (Q = '--.-', Z = '--..', J = '.---') require longer sequences. This frequency-based optimization minimized transmission time on telegraph lines, where operators paid per character. The timing convention uses units: one unit for dots, three units for dashes, one unit of silence between symbols within a character, three units between characters, and seven units between words. Digital encoders represent these timing rules with spaces and delimiters.
The international Morse code (ITU standard) supports A-Z, 0-9, and punctuation including period, comma, question mark, apostrophe, exclamation, slash, parentheses, ampersand, colon, semicolon, equals, plus, minus, underscore, quotation marks, dollar sign, and at symbol. Encoding converts input to uppercase (Morse does not distinguish case) and maps each character to its Morse equivalent. Unsupported characters (emoji, accented letters) are typically skipped or replaced with placeholders, ensuring that the output contains only valid Morse patterns.