The Black Chamber RU

Lesson №05 1840s 17 min

Morse code

Two marks, a short one and a long one, and a rule for how long to stay silent between them. That was enough to wire up the world, call for help from a sinking ship and flash messages from bridge to bridge.

In this lesson

  • how a code differs from a cipher
  • why common letters have short codes, and how the Morse tree works
  • how the timing works: dot, dash and the 1–3–1–3–7 gaps
  • where SOS came from, and how Russian Morse differs

Washington, the Capitol, 24 May 1844. Samuel Morse, a portrait painter by trade, sits at his apparatus and starts pressing a lever. Some forty miles away, in a railway station in Baltimore, his partner Alfred Vail watches a stylus press short and long marks into a moving paper tape. A few minutes later Vail sends the words back: “What hath God wrought”. The line from the Book of Numbers was chosen by young Annie Ellsworth, the daughter of the Commissioner of Patents. From that moment news could travel at the speed of electricity.

A telegraph wire carries exactly one thing: current on or current off. To turn that into text you need an agreement about which patterns of on and off stand for which letters. That agreement is Morse code.

A code is not a cipher

First, the words. A cipher hides meaning: without the key the text can’t be read. A code simply writes the text in other signs, and the table is open to everyone. Morse code has no key; it is printed in handbooks and on posters. It exists not to hide a message but to carry it: down a wire, over the radio, as light or as knocks.

So why is it in a course about ciphers? Because everything went over the air, plain telegrams and secret ones alike. A wartime radio operator copied columns of meaningless letters in Morse, and a code clerk then turned them into an order. The code is the envelope; the cipher is the locked box inside.

Morse was a painter and a professor of art, not an engineer, and Alfred Vail worked with him on both the machine and the code. A popular story says it was Vail who visited a printer’s shop and counted the type in the cases to see which letters were used most, then gave the commonest letters the shortest codes. How true that is, historians debate: Vail himself left no such account.

Long and short

The code has just two signs: the dot, a short signal, and the dash, a long one. A letter is a few of these in a row. A is ·−, B is −···, E is a single dot, T a single dash.

Why was E so lucky? Because it is the most common letter in English, the language the code was built for. Every extra mark on a frequent letter costs time on almost every word, and over thousands of telegrams that adds up to hours. So frequent letters got short codes and rare ones long codes: Q and Z have four marks each. A century later mathematicians would call this idea data compression: the more often a symbol occurs, the shorter it should be written.

All the codes fit neatly into a tree. Start at the root. A dot is a step left, a dash a step right. Wherever you stop, that is your letter. One step left is E, one step right is T. Two steps give I, A, N, M. The deeper you go, the longer the code and the rarer the letter.

Press “·” and “−” to walk down the tree, or click a letter: its path lights up and you hear its code. The switch at the bottom changes to the Russian alphabet.

Notice the gaps in the bottom row: English doesn’t need all sixteen four-mark codes, so some slots stay empty. Switch to Russian and every one of the sixteen is taken. Russian has more letters, so its Morse fills the tree almost completely.

Why is E in Morse code a single dot?

The more often a letter occurs, the more time a short code saves. E, followed by T, is the commonest letter in English, so each gets one mark. The same principle sits at the heart of modern data compression.

It’s all about timing

A dot and a dash differ only in length. But the silences between them carry meaning too: they tell you where a letter ends and where a word ends. Without them the code turns to mush. ···−−−··· could be SOS, but it could also be SMB, VMS, IJS and several more.

So everything in Morse is measured in one unit, the length of a dot:

  • a dot: 1 unit of sound;
  • a dash: 3 units of sound;
  • the gap between marks inside a letter: 1 unit of silence;
  • the gap between letters: 3 units;
  • the gap between words: 7 units.

The 1–3–1–3–7 rule is easy to remember, and you hear it as rhythm. Skilled operators don’t count dots; they hear a whole letter as a little tune. That is why learners are told to learn the sound of each letter, not a picture of dots and dashes.

Speed is measured in words per minute. The standard word is PARIS: with the gap after it, it takes exactly 50 units. Twelve words a minute means 600 units in 60 seconds, a dot one tenth of a second long. Try it yourself.

The key sounds while you hold it. A short press is a dot, a long one a dash. Let go and wait, and the letter is read on its own; wait longer and a space appears. The key adapts to your pace: try sending SOS.

If letters come out wrong, your dashes are probably a bit short or the gaps inside letters a bit long. That is why operators spent months training their hand: a steady rhythm matters more than speed.

Sound, light and SOS

A wire isn’t the only way. When radio arrived at the end of the nineteenth century, Morse code moved onto the air: the transmitter switched its carrier wave on and off, and the operator heard it as a beep in his headphones. Navies flashed Morse with signal lamps from ship to ship, at night, with no wires and no extra ears. The code fits any signal you can switch on and off.

The most famous signal of all is SOS: ··· −−− ···. It was adopted by the international radiotelegraph convention in Berlin in 1906 and came into force in 1908. Despite the legend, SOS doesn’t stand for anything, neither “Save Our Souls” nor “Save Our Ship”. It was chosen for its rhythm: three short, three long, three short can’t be mistaken for anything else, even through crackling static. It is sent as one run, without the usual gaps between letters.

In April 1912 the Titanic’s wireless operator Jack Phillips first sent the older distress call CQD and then, at a colleague’s suggestion, the new SOS as well. It was one of the first times SOS went out over the air in a real disaster.

Morse was taken down by ear, but it can be seen too. Below is an intercept made right in your browser. Under the button is a trace of the signal, the way a pen recorder would draw it: black bars are sound, the spaces are silence.

One night a coast station picked up the name of a ship asking for a harbour pilot. What is the ship called?

Listen to the rhythm or look at the bars. Short ones are dots, long ones dashes; a small gap is inside a letter, a wider one between letters. The name has five letters.

The code is ·−· ·− ···− · −·. Look each letter up in the tree above or in the Morse translator.

Five letters: ·−· is R, ·− is A, ···− is V, · is E, −· is N. The ship is the Raven.

If you’d rather not count by ear, download the WAV and drop it into the translator: it finds the tone, measures the dots and gaps and reads the recording for you. The second door of the quest works the same way.

Russian Morse

Morse code soon spread beyond English. Russian letters were given the codes of similar-sounding Latin ones: А as A, Б as B, В as W, Г as G, Д as D, К as K, Т as T. Sounds that Latin lacks got the spare combinations: Ч is −−−·, Ш is −−−−, Щ is −−·− (the same as Q), Я is ·−·−.

As a result the same code reads differently in each language. ·−− is W in English and В in Russian; −··− is X in English and the soft sign Ь in Russian. An operator copying an intercept has to know what language is being sent. Digits and punctuation, on the other hand, are shared by everyone.

A lighthouse is flashing a lamp at you. It looks like a warning. What about?

Light is the same code, read with your eyes. A short flash is a dot, a long one a dash. If it’s too fast, choose “slow” and note the marks on paper.

The flashes are ·−· · · ··−·. The two letters in the middle are the same.

·−· is R, · is E, another · is E, ··−· is F. The lighthouse warns of a reef.

The two single dots in a row are where timing matters most: only the three-unit gap tells you they are two letters E rather than one letter I.

Morse is a code, not a cipher: the table is public and there is no key. Its strength is simplicity: two marks and the 1–3–1–3–7 rule for gaps let you send text over any signal that can be switched on and off.

An operator hears two letters in a row. How many units of silence must pass before he knows a new word has begun?

The gaps grow in steps: 1 inside a letter, 3 between letters, 7 between words. Because they differ several times over, the ear can tell them apart even at speed.

What to take with you

  • Morse code is a code: it doesn’t hide the text, it lets you send it by wire, radio or light.
  • Common letters got short codes: E and T are a single mark. All the codes form a tree: dot to the left, dash to the right.
  • Everything is measured in dot lengths: a dash is 3, the gaps are 1, 3 and 7. Without the gaps the code can’t be read unambiguously.
  • SOS isn’t an abbreviation but an unmistakable rhythm. Russian Morse borrows from the Latin table, so the same code can mean different letters in different languages.

A dot and a dash are really two states: signal or no signal. Computers live exactly the same way, only they call them one and zero. In the next lesson we see how letters become bits and bytes, and why Base64 encrypts nothing. Next: binary, hex and Base64 →

Tools for this lesson

Everything from the lesson, working: paste your own text.