Tap Code — Full Reference Chart
Tap code encodes each single letter of the alphabet as two short sequences of knocks — a row number, a pause, then a column number — using a 5-by-5 grid with no equipment required beyond a wall, a table, or any surface two people can both reach. It was never designed as a puzzle or a game; it's a real communication method invented under real duress, most famously by American prisoners of war held in North Vietnam, and its design reflects that origin at every step.
Why the Grid Is 5x5 and Not 26 Cells
Twenty-six letters don't divide evenly into a clean grid, so tap code solves the problem by merging two letters into one cell: C and K share a single position, with K simply spelled using C's tap sequence in context (rare enough in practice that the ambiguity almost never causes real confusion for a fluent user). That leaves exactly 25 letters for a 5-by-5 grid — 5 rows, 5 columns, each cell reached by a row-tap-count followed by a column-tap-count. The letter in row 1, column 1 is A; row 1, column 2 is B; row 1, column 3 is C (doubling as K); and so on in reading order through row 5, column 5, which is Z.
How to Tap Out a Single Letter
To send a single letter, tap its row number first, pause clearly, then tap its column number. The letter M sits in row 3, column 2 of the standard grid, so M is three taps, a pause, then two taps. A skilled user builds real speed at this — genuine tap-code conversations among practiced users could run at a meaningful words-per-minute pace despite requiring two separate tap-groups per letter, not unlike how a fluent Morse operator stops consciously counting dots and dashes and starts hearing whole letters.
Where It Actually Came From: American POWs in Vietnam
The system that became known simply as "tap code" was an old, largely forgotten communication method with roots stretching back well before Vietnam, revived under circumstances that made it a genuine lifeline. Air Force Captain Carlyle "Smitty" Harris, shot down over North Vietnam on 4 April 1965 and held at the Hoa Lo prison camp — nicknamed the "Hanoi Hilton" by the prisoners held there — remembered the grid-based idea from a brief mention during military survival training. In June 1965, together with fellow prisoners Lieutenant Phillip Butler, Lieutenant Robert Peel and Lieutenant Commander Robert Shumaker, Harris worked the method into the practical 5-by-5 tap system described on this page and began teaching it to other captured Americans. From that small starting group, tap code spread cell to cell through Hoa Lo and other North Vietnamese POW camps, becoming a working communication network that let isolated, often physically separated prisoners exchange names, encouragement, coordinated resistance policy, and news for years, entirely by knocking on shared walls and pipes where guards could see but not necessarily understand what was happening.
Why a Knocking Code Specifically, Not Whispering or Notes
The method's real genius was how well it fit the actual constraints POWs were operating under. Whispering through a wall risked being overheard by a guard walking a corridor; passing written notes required physical access and left dangerous physical evidence if discovered. A quiet series of taps on a shared wall — easily disguised as the ordinary incidental sounds of a person moving around a small cell — could be sent and received without ever needing direct sight or speech between the two prisoners communicating, and without leaving anything a guard could later find and use as evidence of coordinated resistance.
Beyond Single Letters: Real Shorthand Developed in Use
Prisoners using tap code for years under real pressure didn't stop at spelling every word letter by letter — they developed genuine shorthand conventions layered on top of the base grid: standard abbreviated sign-offs, a recognized "shave-and-a-haircut" style opening tap sequence to signal a new message was starting, and a fast "acknowledge" tap to confirm a message had been received without needing to spell out a full word. That kind of organic shorthand evolution under real operational pressure is a detail rarely found in more academic accounts of cipher and code systems, and it's part of why tap code is remembered as a genuinely lived communication system rather than a historical curiosity.
The Underlying Idea: A Polybius Square
Structurally, tap code is a fairly direct descendant of the ancient Polybius square, a much older grid-based letter-encoding idea attributed to the ancient Greek historian Polybius, writing in the 2nd century BC, originally devised as a way to signal messages over distance using torches held up in different grid-position combinations rather than for concealment. The core mechanical idea — locate a letter by its row and column position in a fixed grid, then transmit those two numbers rather than the letter itself — is exactly what tap code inherits, more than two thousand years later, just substituting knocks for torch signals and merging C and K to fit a clean 5-by-5 layout instead of ancient Greek's larger alphabet.
Where Tap Code Shows Up Today
- Military survival, evasion, resistance and escape (SERE) training, where it's still taught to personnel as a genuine low-tech communication method for captivity scenarios.
- Prison and detention settings more broadly, independent of any military connection, wherever inmates need a communication method that doesn't require sight, speech, or written material.
- Escape rooms and puzzle-hunt design, where its real, documented wartime history gives designers a built-in, historically grounded narrative hook that a purely invented cipher wouldn't carry.
- Popular culture and journalism about the Vietnam War POW experience, where tap code is frequently cited by name as a specific, verifiable detail of how prisoners maintained morale and organization under extended isolation.
"Shave and a Haircut": How a Conversation Actually Opened
Before spelling out any real message, prisoners needed a fast, unmistakable way to confirm someone was actually on the other side of a wall and ready to receive — sending a full sentence to an empty cell, or worse, an occupied guard post, was a real risk. The solution POWs settled on was tapping out the familiar five-beat "shave and a haircut" rhythm and waiting for the answering two-beat "two bits" reply; hearing that specific two-tap answer confirmed a fellow American prisoner was listening and ready, without either party needing to risk a longer, more identifiable message first. That opening handshake, along with a distinct "acknowledge" tap and standard sign-offs, meant tap code functioned as a complete lightweight communication protocol, not just a letter-substitution chart.
A Different Channel, Same Prison: Denton's Blinked Morse
Tap code wasn't the only improvised signal to come out of Hoa Lo during those same years. On May 2, 1966, Navy Commander Jeremiah Denton — held in the same prison system where tap code was actively spreading cell to cell — was put in front of a camera for a forced propaganda interview with a visiting Japanese television crew. Facing bright studio lighting that gave him a plausible reason to blink heavily, Denton spelled out T-O-R-T-U-R-E in Morse code with his own eyelids, giving outside observers their first clear confirmation that American POWs were being abused. It's a useful contrast with tap code rather than a repeat of it: a wall and a willing neighbor on the other side call for taps, but a camera pointed straight at a prisoner's face calls for whatever channel is actually still available — in Denton's case, that meant his own eyes were the only wall left to knock on.
A Worked Example: "HELP"
H is row 2, column 3 (two taps, pause, three taps). E is row 1, column 5 (one tap, pause, five taps). L is row 3, column 1 (three taps, pause, one tap). P is row 3, column 5 (three taps, pause, five taps). A full message strings these letter-pairs together with a clear pause between each letter's own two tap-groups, exactly the same letter-boundary discipline this site's Morse Code reference describes for dot-dash timing — a different physical signal entirely, but the same underlying communication problem of marking clearly where one character ends and the next one begins.
Frequently Asked Questions
Why merge C and K specifically, instead of some other letter pair?
C and K represent very similar sounds in English and are rarely both needed to distinguish two genuinely different words in a short tapped message, which made them the practical, low-ambiguity choice for merging 26 letters down to a clean 25-cell grid — a K is simply tapped using C's position, understood correctly from the surrounding context of the rest of the word.
Is tap code the same thing as Morse code, just done by knocking instead of radio?
No — Morse code assigns each letter a unique pattern of two signal lengths (dots and dashes); tap code assigns each letter a grid coordinate (row, then column) using identical short taps throughout, with no long/short distinction at all needed to tell one tap from another. They solve a similar communication problem with a genuinely different underlying structure and a different physical skill to learn.
Did tap code exist before the Vietnam War, or was it invented by the POWs who used it?
The underlying grid-tapping idea predates Vietnam considerably, tracing back to the ancient Polybius square, and had seen earlier, more limited use in prior conflicts; what's specifically credited to Carlyle Harris and the Hoa Lo POWs is reviving, refining and spreading it as a full working communication network under those exact captivity conditions, not inventing the underlying concept from nothing.
Can tap code be adapted to languages other than English?
In principle yes, since it's really just a coordinate system layered onto whatever 25-or-so-letter alphabet is being used, but the standard grid described here was built specifically around the English alphabet and its C/K merger, so a different language would need its own grid layout, with its own letter-merging decision, to handle its own alphabet and letter count cleanly.