Knocks on the Wall: The Real History of the Prisoners' Tap Code
Strip a prisoner of everything — letters, visitors, speech, even a view of another human being — and one channel survives: the wall. Two men in adjacent cells, some concrete, and knuckles are enough to carry the entire alphabet. The system that grew out of that constraint is the tap code: a letter grid addressed in knocks, five-by-five, older than radio and still in use. It is not morse code, though the two are constant companions in every prison story; it is a separate engineering answer to a crueler channel than any radio operator ever faced.
This page tells the tap code's full history for the first time on this site: its documented origin twenty-two centuries ago in Greek military signaling, its arrival in modern prison camps, its famous role in Vietnam (where Jeremiah Denton's morse blink made television history on a separate channel — that story lives in our military collection), and its quiet survival in prisons and escape rooms today. Along the way it answers the question every reader asks first: why not just tap morse? For hands-on practice, our tap code tool encodes and decodes the grid in real time; keep it open in a second tab while you read.
Where does the tap code come from? Polybius and the square
The tap code's ancestor is one of the oldest documented signaling systems in the world, described by the Greek historian Polybius in the second century BC. In Book X of his *Histories*, Polybius — writing as a pragmatic military analyst, not a mathematician — set out a method for spelling any message across a distance using torches: a five-by-five grid of the alphabet (with I and J sharing a cell, since Greek and Latin letter counts did not divide neatly), addressed by two numbers, row then column. Raise one torch on the left for row one; raise the column count on the right. A general at one hill could spell orders to a garrison on the next, no wire, no fire-beacon vocabulary limits, just counting.
Polybius was solving the same problem every later signalman inherited: how to send arbitrary text over a channel that can only count. The square he described — now called the Polybius square — is precisely the grid behind the prisoners' code, transmitted unchanged except for the medium: instead of torches raised at dusk, knuckles on a cell wall. Twenty-two centuries of engineering would pass, and the receiving algorithm would remain 'count, pause, count.' You can see the full grid, with its modern C/K variant below, on the tap code reference page.
How does the tap code actually work?
The mechanics take five minutes to learn. Write the alphabet into a five-by-five square. The standard modern version — the one American prisoners of war standardized — puts C and K in the same cell, because the grid has only twenty-five slots for twenty-six letters and C/K was the least ambiguous pair to merge. To send a letter, knock its row number, pause, knock its column number. To spell TAP: T sits in row 4, column 4 — four knocks, pause, four knocks. A is row 1, column 1 — one knock, pause, one knock. P is row 3, column 5 — three knocks, pause, five knocks. Longer pause between letters; longest pause between words. That is the entire protocol.
Notice what the system demands of the receiver: only counting. No sense of rhythm, no dot-versus-dash judgment, no tempo. Four knocks through a wall is four knocks whether the sender is exhausted, panicked, or bruised — counting is robust to everything except losing count, which the fixed five-by-five structure itself guards against (a count of six is an error, not a letter, and the receiver waits for the next group). In communication-engineering terms, the code trades speed for a tolerance for channel brutality that few human signaling systems match. For contrast, the same word in morse is T - A .- P .--. — faster by far, but dependent on every element landing with the right duration. Both systems, side by side, are compared in depth in our morse-versus-tap-code analysis.
Why didn't prisoners just tap morse?
Many knew it. Twentieth-century airmen were trained signalmen; plenty could send beautiful morse with a straight key, and some tried tapping dots and dashes through the walls in the war's first camps. The problem is physical, not mental. Morse lives on a timing ratio — a dash is three times a dot, and the letter gap is the receiver's only punctuation. Through concrete, at odd hours, by starved men using fists and heels, that ratio collapses: a weak tap reads short and a hard rap reads long regardless of intent, and the receiver cannot tell a fat dash from two dots run together. The faster code dies in the wall's noise.
The tap code gives up speed and buys certainty. This was the same engineering judgment, made independently by prisoner after prisoner, that a radio operator makes when propagation turns bad: drop to the mode the channel can actually carry. The Vietnam-era prisoners kept both systems in the toolkit — morse where timing was controllable (a blink, a cough, a finger tapped softly on a cup, channels operated by one careful sender), the grid code for wall-to-wall broadcasting. Jeremiah Denton's televised blink of T-O-R-T-U-R-E in 1966 was morse precisely because his own eyelids, under his own discipline, could hold a ratio; the cell network ran on knocks. The full story of that interview, and of the naval officer behind it, is told in our blink-signaling guide and in the military stories collection.
The Civil War: taps in the first military prisons
The tap code's modern prison career begins, on the surviving evidence, in the American Civil War. Both sides operated prison camps whose conditions were, by later Geneva standards, catastrophic — Andersonville in the Confederacy and camps like Johnson's Island and Camp Douglas in the Union held tens of thousands. Surviving accounts and postwar memoirs describe prisoners communicating cell to cell by knocking, including coded arrangements worked out ad hoc; historians of the camps treat wall-knocking as a documented feature of prison life rather than a single invention with a named author. The code arrived the way most folk technologies arrive: not by patent but by necessity, rediscovered wherever the constraint appeared.
It is worth being precise about evidence here, in a way the internet's copy-paste prison trivia usually is not. For the Civil War camps, the documentation is memoiristic — real, but scattered. For the twentieth century, it becomes overwhelming: training manuals, debriefings, and hundreds of repatriated prisoners' testimony. The pattern across all of it is the same square, because the constraint that produced it never changed. Twenty-six letters, twenty-five cells, two numbers per letter, one wall.
World War II: the grid goes to war
By the Second World War, wall-tapping was institutional. In the German camps holding captured Allied airmen — the Stalag Luft compounds — the escape organizations that later became famous through memoirs like *The Great Escape* ran intelligence and morale networks in which tapping was a standard channel; former prisoners describe learning 'the knock' as part of camp induction, passed to each new arrival along with the location of the escape committee's representative. The Red Cross parcel line, the tunnel sand dispersal rosters, the watch lists of informers — a surprising share of camp administration traveled by row-and-column knocks between cells that guards could not silence without rebuilding the architecture.
The Pacific theater was crueler and the code mattered more. Allied prisoners of the Japanese, often held in isolation and denied even the camp-network amenities of the European Luft camps, used tapping as a lifeline; accounts from camps in the Philippines, Formosa, and the home islands describe the same grid doing the same work. The lesson the wars delivered, camp by camp, was structural: any channel a guard cannot see and cannot jam is a channel prisoners will alphabetize. When the Vietnam War began, the incoming airmen already knew what to build.
Vietnam: the Hanoi Hilton runs on knocks
The prison the Americans called the Hanoi Hilton — Hòa Lò, in central Hanoi — is where the tap code reached its historical peak. The captured airmen of the mid-1960s, many of them naval and air force officers, organized themselves deliberately: they standardized the 5×5 C/K grid across every cell block, set communication discipline (slow, repeat, confirm), and built a chain of command that ran through the walls. Senior officers among them — James Stockdale, later awarded the Medal of Honor, is the name every history of the prison returns to — used the network to authenticate new arrivals, impose a unified policy on propaganda cooperation, and move both orders and news across a camp the North Vietnamese designed to be an information vacuum.
The guards understood something was happening and could not stop it; you cannot confiscate a wall. They could and did punish suspected communicators, which raised the code's stakes and slowed its tempo, and prisoners responded with even more redundancy. The full story — the network's organization, the price paid for a mis-sent group, and how the same men used morse on the channels that could hold its timing — is told in detail in our military morse stories; the tap code's technical workings, including the exact grid the prisoners used, are interactive on the tap code page. No surviving communication system has a more dramatic proof of concept.
Do prisoners still use the tap code today?
Yes — not as history but as current practice. Reporting on contemporary American and European prisons consistently describes inmates communicating between cells and tiers by knocking codes, including through plumbing and ventilation pipes that carry sound between areas walls do not; correctional officers interviewed in such coverage describe the knocks as a routine part of contraband and gang-communication enforcement. The modern setting has changed the content (coordinating movement, warning of searches, talking between tiers) but not the protocol: it is still the counting square, because the constraint — no devices, hostile acoustics, human senders — has not changed either. A code that survives from torch signals to prison pipes is not a relic; it is a fitted solution.
The other place ordinary people now meet the tap code is deliberately recreational: escape rooms. Designers use taps as an audio puzzle because, like the prisoners' guards, they can put a message behind a wall and let teams earn it by counting; our escape-room signaling guide covers how these puzzles are built and solved. If you want the skill before your next room — or just want to talk to a friend through a wall as an experiment — the practice mode in the tapping game drills exactly this rhythm.
Learn the knock yourself
The tap code is honestly the easiest signaling system in this site's universe to acquire: an evening, a partner, and a table. Memorize the grid (write it out three times and you are most of the way there), then send slow, confirmed letters — TAP is four-four, one-one, three-five — until counting feels automatic. Then raise the speed. Use the tap code encoder to generate drills and check yourself, and the tapping game to train reception against a clock. For the full experience, work out an arrangement with someone in another room and a shared wall or table leg; you will discover within ten minutes why every prison generation reinvented the same protocol.
And learn the other system too, because each is complete only against the other. Morse gives you speed and a global audience of operators — start with the learning guide and the morse chart, and test yourself letter by letter in the games arcade. Then, when you can send SOS as morse ...---... and as knocks (four-three, three-four, four-three), you will hold in one head the two answers separated by a wall: the fast code that needs a clean channel, and the slow code that needs nothing but a surface and a listener.