Morse Code
The dot-and-dash character encoding devised for Samuel Morse's electric telegraph, publicly launched in 1844 and still keyed today by radio amateurs, aviation beacons and anyone flashing SOS.
Created by Samuel F. B. Morse and Alfred Vail (original); Friedrich Clemens Gerke (International revision)
Morse code is not a programming language. It has no variables, no control flow and no compiler. What it does have is a claim to be one of the first practical schemes for turning human text into a stream of binary signals: a key closed or open, a current on or off, a light lit or dark. Every letter becomes a short pattern of brief and long pulses separated by silences of precise length. That idea, born to serve Samuel Morse’s electric telegraph in the late 1830s, carried most of the world’s long-distance messages for roughly a century. It still has not entirely gone away.
It sits in the CodeArchaeology encyclopedia as an ancestor of the problems programmers still solve: how to encode characters, how to make common symbols cheap, how to delimit units in a serial stream, and how to standardize all of that across nations and machines.
History and Origins
The telegraph comes first
Morse, an American painter, began working on an electromagnetic telegraph in the 1830s, drawing on the electromagnet research of physicist Joseph Henry. His first scheme for a code was not alphabetic. Morse planned to transmit only numerals and have the receiver look each number up in a codebook of words.
In September 1837 Alfred Vail, a machinist and recent New York University graduate whose father owned the Speedwell Ironworks in Morristown, New Jersey, saw one of Morse’s demonstrations. Vail offered to build the apparatus at his own expense in exchange for a share of the proceeds. On 6 January 1838 the partners made their first successful transmission at Speedwell, over about two miles of wire. Morse received U.S. Patent No. 1,647 for the telegraph on 20 June 1840.
From numbers to letters
At some point in this period, generally placed between about 1838 and 1840 (sources disagree on the year), the numeric codebook gave way to a code with a pattern for every letter and digit. How much of the alphabet was Morse’s work and how much was Vail’s has been argued over ever since. Vail’s descendants and several historians credit Vail, while Morse kept the patent rights to the whole system. According to the often-repeated account, Vail estimated English letter frequencies by counting the movable type in a Morristown newspaper’s type cases. He then gave the most common letters the shortest patterns, so that E became a single dot and T a single dash.
“What hath God wrought”
Congress appropriated $30,000 in 1843 to build an experimental line between Washington and Baltimore. On 24 May 1844 Morse, sitting in the old Supreme Court chamber of the U.S. Capitol, sent the Bible verse “What hath God wrought” (Numbers 23:23) to Vail at the Baltimore and Ohio Railroad depot in Baltimore. That ceremonial message, the opening of the first government-funded line, is the reason this page uses 1844 as its first-appearance year. Earlier dates (1837 or 1838) are sometimes given for the code’s origin, but they belong to experiments, small demonstrations at Speedwell and the earlier numeric scheme.
Gerke’s rationalization
The code Morse and Vail put into service, now called American Morse or Railroad Morse, was more complicated than the one most people know. It had dashes of three different lengths (the letter L and the digit 0 used longer dashes) and extra internal gaps inside some letters such as C, O, R and Y. Operators could mistake those gaps for the space between two letters.
In 1848 Friedrich Clemens Gerke, an inspector for the new electric telegraph company running between Hamburg and Cuxhaven, rewrote nearly half of the alphabet and all of the numerals. His version kept only two elements, a dot and a dash three times as long, and made every internal gap the same length. The Austro-German Telegraph Union adopted Gerke’s code in 1851. A slightly modified form became the international standard after the first International Telegraph Convention, signed in Paris on 17 May 1865, which also founded the International Telegraph Union, the forerunner of today’s ITU. The international code took most of Gerke’s letters, but according to Wikipedia’s account it borrowed O and P from a code devised by Carl August von Steinheil, added a separate J (Gerke had not distinguished I from J) and changed a few others.
The United States held out. An 1854 attempt to make International Morse the U.S. standard was reportedly rejected by the telegraph companies, Western Union among them, which had no wish to retrain their staff. Part of the argument was speed: with fewer dashes, American Morse could be sent faster by the same operator, though estimates of the margin vary from about 5% to at least 20% depending on the source, and no controlled comparison is cited for either figure. Because messages on the transatlantic cables arrived in the international code and had to be re-sent in American Morse, some U.S. operators needed to know both.
Design
A variable-length binary code
Morse code is built from two signal elements and three kinds of silence. All of them are measured in a single time unit, the length of one dot:
| Element | Duration |
|---|---|
| Dot (dit) | 1 unit on |
| Dash (dah) | 3 units on |
| Gap between elements within a character | 1 unit off |
| Gap between characters | 3 units off |
| Gap between words | 7 units off |
Because the gaps carry meaning, Morse is really a ternary or timing-based code rather than pure binary, and that is part of why it survives noisy channels and imperfect human hands. In software terms, the inter-character gap works as a delimiter. Unlike a prefix code, Morse needs that gap: without it, ·– could be “A” or “ET”.
Making common letters cheap
The design principle Vail is credited with, short codes for frequent letters, is the same one that underlies later variable-length compression schemes:
E · T –
A ·– N –·
I ·· M ––
S ··· O –––
H ···· Q ––·–
The rarest English letters (Q, J, X, Y, Z) have four-element codes, while E and T need just one. The economy is not perfect. Gerke’s own O (·–···) was notoriously long for such a common vowel, and the international ––– used today is a slow three-dash pattern.
Words per minute: the PARIS standard
Sending speed is measured in words per minute (WPM), which requires agreeing on what a “word” is. The usual standard word is PARIS, which works out to exactly 50 units including the trailing word gap:
P ·––· A ·– R ·–· I ·· S ···
11 + 3 5 + 3 7 + 3 3 + 3 5 + 7 = 50 units
From that comes the standard conversion: the length of one dot in milliseconds is 1200 / WPM, so at 20 WPM a dot lasts 60 ms. A second standard word, CODEX, is 60 units long and models five-letter groups of random characters. Speeds measured against the two standards can differ by up to about 20%, which matters when comparing records from different eras.
Prosigns and abbreviations
Hand-sent Morse is slow, so operators developed shorthand. Prosigns are characters run together without the normal inter-letter gap to form a single procedural signal. The best known is the distress call ···–––···, which is sent as one continuous sign and not as the three letters S, O, S. Radio traffic also leans heavily on Q codes (QTH for “my location”, QRP for “reduce power”) and abbreviations such as CQ (“calling any station”) and 73 (“best regards”).
Key Features
- Medium-independent. The same code works over a telegraph wire, a radio carrier, a signal lamp, a heliograph, a flashlight, a car horn, taps on a pipe or blinks of an eye.
- Minimal hardware. Radiotelegraphy is plain on-off keying of a carrier, which needs far simpler transmitters than voice.
- Narrow bandwidth. A Morse signal at ordinary hand-keyed speeds needs roughly 100–150 Hz of spectrum (150 Hz is the necessary bandwidth in the common ITU emission designator for CW,
150HA1A), compared with roughly 2,400–2,800 Hz for single-sideband voice. Required bandwidth rises with keying speed. That lets receivers use tight filters, which is why CW is favoured for weak-signal and long-distance amateur contacts. - Human-decodable. Trained operators copy Morse by ear with no machine at all. According to commonly cited accounts, skilled operators can often copy above 40 WPM, and some amateur clubs set a 60 WPM membership standard.
- An operator’s “fist”. Hand-keyed Morse carries the sender’s personal rhythm, and experienced operators can recognize individuals by their keying alone.
Evolution
Radio and the sea
From the 1890s, wireless telegraphy carried Morse through the air instead of along wires, and it quickly became the language of ships. Because radio crossed borders, a single code was needed. The 1912 London Radiotelegraph Convention stated that “the signals to be employed are those of Morse International Code” for radiograms, although American Morse lingered on U.S. landlines and in some domestic coastal radio.
Distress signalling became standardized in the same era. The Marconi company had introduced CQD in 1904. The first International Radiotelegraph Convention, signed in Berlin on 3 November 1906 and effective 1 July 1908, adopted the ···–––··· signal instead. When RMS Titanic sank in April 1912, its operators sent both.
Aviation and war
Morse moved into aviation from the 1920s. Beginning in the 1930s, civil and military pilots were expected to know Morse, partly to identify radio navigation beacons by their call letters. Through the Second World War, radiotelegraphy carried encrypted traffic between warships and their bases and between fast-moving armies and their headquarters.
Decline
Satellite and automated digital systems made Morse unnecessary for commercial traffic in the second half of the twentieth century:
- The French Navy stopped using Morse on 31 January 1997. Its final message is commonly translated as “Calling all. This is our last cry before our eternal silence.”
- The Global Maritime Distress and Safety System replaced Morse as the maritime distress standard in 1999.
- In the United States, the final commercial Morse transmission is reported to have been sent on 12 July 1999, signing off with Morse’s own 1844 message.
- The 2003 World Radiocommunication Conference made Morse optional for amateur radio licences. The U.S. FCC dropped it from every amateur licence class effective 23 February 2007.
Still being revised
The code is not entirely frozen. In 2004 the ITU added the @ sign (·––·–·, written as the digraph AC) so that amateurs could exchange email addresses. Sending “AT” as two letters runs together into something that sounds like W. The current definition is ITU-R Recommendation M.1677-1, International Morse code, approved in October 2009.
Current Relevance
Morse code is classed here as historical because its commercial and military-communications role is essentially over, but it is far from extinct:
- Amateur radio is its largest living community. CW is allowed on all U.S. amateur bands, and clubs such as the CW Operators’ Club cater to people who use it every day.
- Aviation beacons (VORs and NDBs) still transmit Morse identifiers, though pilots can read the pattern off the chart and many receivers decode it automatically.
- Naval signal lamps still flash Morse when ships need to keep radio silence.
- Assistive technology. Morse lends itself to single-switch, two-switch and sip-and-puff input for people with severe motor disabilities, and mainstream mobile keyboards have offered Morse input modes.
- Commercial licensing. The FCC still issues a Radiotelegraph Operator License to applicants who pass both a code test and a written exam.
Why It Matters
For programmers, Morse code is a working example of ideas that later became formal theory:
- Character encoding. It mapped an alphabet onto signals decades before Baudot, ASCII or Unicode, and it ran into the same questions they did: which characters to include, how to handle national letters (Gerke’s version added codes for the German umlauted vowels and CH), and how to add new symbols like @ without breaking existing users.
- Frequency-based code lengths. Giving short codes to common symbols is the basic idea of entropy coding. Morse uses it informally and without the prefix property that later variable-length codes guarantee.
- Framing by timing. Morse uses silence of defined lengths to mark character and word boundaries, a problem every serial protocol has to solve.
- Standardization. The rivalry between American and Continental Morse, and the 1865 treaty that settled it for most of the world, is an early case study in interoperability. Its institutional result, the ITU, still publishes the standard.
More than 180 years after “What hath God wrought”, Morse code is one of the oldest electrical encodings still in active use, and it remains understandable to a person with nothing but a flashlight and a list of dots and dashes.
Timeline
Notable Uses & Legacy
Baltimore–Washington telegraph line
The line that carried the code's famous 1844 opening message, built with a $30,000 appropriation from Congress; the original paper tape of "What hath God wrought" is held by the Library of Congress
Western Union and U.S. railroads
American (Railroad) Morse remained the working code of U.S. landline telegraph companies and railroad dispatchers long after the rest of the world switched to International Morse
Maritime distress (RMS Titanic, 1912)
Titanic's Marconi operators sent both the older CQD call and the newly standard SOS in April 1912; Morse remained the international distress standard at sea until 1999
Aviation radio navigation aids
VOR and NDB beacons continuously transmit a short Morse identifier so pilots can confirm they are tuned to the right station; the dots and dashes are printed next to each beacon on aeronautical charts
Amateur radio (CW)
Continuous-wave Morse is still widely used by radio amateurs for weak-signal and low-power contacts, and is permitted on all U.S. amateur bands
Jeremiah Denton, 1966
The U.S. Navy pilot, held as a prisoner of war and forced into a North Vietnamese propaganda interview, blinked the word TORTURE in Morse code