Skip to content
MorseBeep
🇬🇧 EN

History

The Tap Code: How Prisoners Knocked Messages Through Walls

By Kashif Sulehria. . 3 min read.

The tap code, also called the knock code, spells each letter with two groups of knocks: the first gives the row and the second the column of the letter in a 5 by 5 grid. It is not Morse code. It was used by American prisoners of war in Vietnam because a knock on a wall can't be made short or long, only counted, and the tap code needs nothing but counting.

The grid

The alphabet is laid out in five rows of five letters. With 26 letters and 25 squares, C and K share a square.

1 2 3 4 5
1 A B C/K D E
2 F G H I J
3 L M N O P
4 Q R S T U
5 V W X Y Z

To send a letter, knock the row number, pause, then knock the column number. H is in row 2, column 3, so it is two knocks, a pause, three knocks. A longer pause separates letters.

So HI is knock knock, knock knock knock, then knock knock, knock knock knock knock. SOS is four and three for S, three and four for O, four and three again.

Why not Morse code?

Morse needs two different signals, a short one and a long one. A knock on a wall or a pipe is always short, and all knocks sound alike, so there is nothing to tell a dot from a dash. You could knock in a rhythm, but the timing is fragile through a wall and easy to lose.

The tap code avoids timing almost entirely. It only asks the listener to count knocks and notice pauses, which is reliable even through thick walls and with no training. That is why, in Vietnam, the tap code became more widely used among prisoners than Morse.

The Hanoi Hilton

The best-known use of the tap code was by American prisoners of war in North Vietnam. It was introduced in June 1965 in the Hỏa Lò prison, nicknamed the Hanoi Hilton, by four prisoners: Captain Carlyle "Smitty" Harris, Lieutenant Phillip Butler, Lieutenant Robert Peel and Lieutenant Commander Robert Shumaker. Harris had heard of prisoners using a tap code in the Second World War, and remembered an Air Force instructor who had mentioned it.

Prisoners were held in isolation and forbidden to talk. By overcoming that isolation, the tap code let them keep a chain of command and keep up morale. Men sitting side by side could even tap it on each other's thigh. For prisoners held alone for years, it was a lifeline.

Older than Vietnam

The idea of a grid of letters goes back to antiquity: it is known as the Polybius square, after the Greek historian. Prisoners of the Russian tsars are said to have used a Cyrillic version, and Arthur Koestler described a knock code in his 1941 novel Darkness at Noon.

Tap code and Morse together

The two codes complement each other. Where a signal can be made long and short, such as a light, a sound, a radio or a blinking eye, Morse is faster. Where it cannot, as with knocks, the tap code works better. In 1966 one prisoner of war in Vietnam, Jeremiah Denton, used the other route: he blinked a message in Morse code during a televised interview.

Try it

Knock out your name on a table using the grid above. Then compare it with Morse: type the same name into the translator and listen. Morse is quicker, but only because it has two kinds of signal to work with. SOS, for example, is nine signals in Morse, ...---..., but 21 knocks in the tap code.

Sources

Spotted a mistake? Tell us and it will be corrected. Every dot-and-dash example on this page plays when you tap it, using your speed and tone from the translator.

All 20 articles