Tap code

From Wikipedia, the free encyclopedia
Latin alphabet tap code table
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

The tap code, sometimes called the knock code, is a way to encode text messages on a letter-by-letter basis in a very simple way. The message is transmitted using a series of tap sounds, hence its name.[1]

The tap code has been commonly used by prisoners to communicate with each other. The method of communicating is usually by tapping either the metal bars, pipes or the walls inside a cell.


The tap code is based on a Polybius square using a 5×5 grid of letters representing all the letters of the Latin alphabet, except for K, which is represented by C.

Each letter is communicated by tapping two numbers, the first designating the row and the second (after a pause) designating the column. For example, to specify the letter "B", one taps once, pauses, and then taps twice. The listener only needs to discriminate the timing of the taps to isolate letters.

To communicate the word "hello", the cipher would be the following (with the pause between each number in a pair being shorter than the pause between letters):

2, 3
1, 5
3, 1
3, 1
3, 4
•• •••   • •••••   ••• •   ••• •   ••• ••••

The letter "X" is used to break up sentences, and "K" for acknowledgements.

Because of the difficulty and length of time required for specifying a single letter, prisoners often devise abbreviations and acronyms for common items or phrases, such as "GN" for Good night, or "GBU" for God bless you.[2]

By comparison, Morse code is harder to send by tapping or banging because it requires the ability to create two clearly distinguishable forms of tap, such as varying the pitch or volume. Morse code also takes longer to learn, where the tap system simply requires one to know the alphabet and the short sequence "AFLQV" (the initial letter of each row), without memorising the entire grid. For example, if a person hears four knocks, they can think "A... F... L... Q". If after a pause there are three knocks, they think "Q... R... S" to arrive at the letter S.


Cyrillic alphabet tap code[3]
1 2 3 4 5 6
1 А Б В Г Д Е/Ё
2 Ж З И К Л М
3 Н О П Р С Т
4 У Ф Х Ц Ч Ш
5 Щ Ъ/Ь Ы Э Ю Я

The origins of this encoding go back to the Polybius square of Ancient Greece. Like the "knock code", a Cyrillic script version is said to have been used by nihilist prisoners of the Russian czars.[4] The knock code is featured in Arthur Koestler's 1941 work Darkness at Noon.[5] Kurt Vonnegut's 1952 novel Player Piano also includes a conversation between prisoners using a form of tap code. The code used in the novel is more primitive and does not make use of the Polybius square (e.g. "P" consists of sixteen taps in a row).

United States prisoners of war during the Vietnam War are most known for having used the tap code. It was introduced in June 1965 by four POWs held in the Hỏa Lò ("Hanoi Hilton") prison: Captain Carlyle "Smitty" Harris, Lieutenant Phillip Butler, Lieutenant Robert Peel, and Lieutenant Commander Robert Shumaker.[2][6] Harris had heard of the tap code being used by prisoners in World War II[7] and remembered a United States Air Force instructor who had discussed it as well.[2][8]

In Vietnam, the tap code became a very successful[9] way for otherwise isolated prisoners to communicate.[7][10] POWs would use the tap code in order to communicate to each other between cells in a way which the guards would be unable to pick up on.[11] They used it to communicate everything from what questions interrogators were asking (in order for everyone to stay consistent with a deceptive story), to who was hurt and needed others to donate meager food rations. It was easy to teach and newly arrived prisoners became fluent in it within a few days.[12][13] It was even used when prisoners were sitting next to each other but not allowed to talk, by tapping on another's thigh.[13] By overcoming isolation with the tap code, prisoners were said to be able to maintain a chain of command and keep up morale.[7][14]

In 1980, a doctor sentenced to life in solitary confinement in Somalia used tap code to share the entirety of Tolstoy's Anna Karenina, nearly 2 million letters, via tap code with fellow prisoners.[15]


  1. ^ The Handbook Of The SAS And Elite Forces. How The Professionals Fight And Win. Edited by Jon E. Lewis. p.199-Tactics And Techniques, Evasion, Capture And Escape. Robinson Publishing Ltd 1997. ISBN 1-85487-675-9
  2. ^ a b c "'Return with Honor': The Tap Code". American Experience. PBS. 1999. Archived from the original on 2012-11-10. Retrieved 2008-04-08.
  3. ^ "Far Outliers: Russian Prison Tapping Code". April 14, 2005. Archived from the original on August 15, 2014. Retrieved August 8, 2014.
  4. ^ David Kahn, The Codebreakers – The Story of Secret Writing. 1967. ISBN 978-0-684-83130-5.
  5. ^ Koestler, Arthur, Darkness at Noon (1941). Translated by Daphne Hardy. See page 19 of the Bantam Publishing paperback, 1981 printing for more info.
  6. ^ Borling, John (2013). Taps on the Walls: Poems from the Hanoi Hilton. Priztker Military Library: Master Wings Publishing. pp. 1–9. ISBN 978-0-615-65905-3.
  7. ^ a b c Staff Sgt. Jason Tudor (1998-03-18). "Vets, Flyers discuss ideology, time in POW camps". Air Force News Service. Archived from the original on 2007-12-03. Retrieved 2008-04-08.
  8. ^ Townley, Alvin. (4 February 2014). Defiant : the POWs who endured Vietnam's most infamous prison, the women who fought for them, and the one who never returned (First edition : February 2014 ed.). New York. ISBN 9781250006530. OCLC 862575088.{{cite book}}: CS1 maint: location missing publisher (link)
  9. ^ Peterson, Gordon I; Taylor, David C (March 2016). "Intelligence Support to Communications with US POW's in Vietnam". Studies in Intelligence. 60. Center for the Study of Intelligence Publications: 1–15. Archived from the original on 2019-05-08. Retrieved 2019-05-23.
  10. ^ Fretwell, Peter; Kiland, Taylor Baldwin (2013). Lessons from the Hanoi Hilton: Six Characteristics of High Performance Teams. Annapolis, Maryland: Naval Institute Press. pp. 63–67. ISBN 978-1-61251-217-4.
  11. ^ Hirsch, James S (2004). Two Souls Indivisible: The Friendship that saved two POW's in Vietnam. New York: Houghton-Mifflin. pp. 161-162. ISBN 0618273484.
  12. ^ McCain, John; Mark Salter (1999). Faith of My Fathers. Random House. pp. 211–12. ISBN 0-375-50191-6.
  13. ^ a b Brace, Ernest C. (1988). A Code to Keep: The true story of America's longest held civilian prisoner of war in Vietnam. St. Martin's Press. pp. 171–72, 187–88. ISBN 0-7090-3560-8.
  14. ^ Naughton, Robert J (1975). "Motivational Factors of American Prisoners of War Held by the Democratic Republic of Vietnam". Naval War College Review. 28. Archived from the original on 2019-05-04. Retrieved 2019-05-04.
  15. ^ "Rough Translation: How 'Anna Karenina' Saved A Somali Inmate's Life". NPR. 2017-09-11. Archived from the original on 2023-06-26.

External links[edit]