Tap Code Encoder / Decoder
Prison wall cipher used by Vietnam War POWs — 5×5 Polybius grid, audio tap playback.
| 1 | 2 | 3 | 4 | 5 |
|---|
How to Use the Tap Code Tool
- Choose Encode or Decode — select the direction with the option chips.
- Enter your message — type plaintext to encode, or tap patterns (use dots or numbers) to decode.
- Read the output — encoded messages show dot patterns; decoded output shows the original text.
- Audio playback — click the Audio chip then Play Taps to hear your message tapped out.
About the Tap Code
The Tap Code is a form of communication based on the Polybius square, used primarily by prisoners to communicate through walls. In the Tap Code, the letter K is omitted from the grid and C is used for K's sound, reducing the alphabet to 25 letters that fit in a 5×5 grid. Each letter is represented by two numbers — the row and column — which are communicated as groups of taps separated by pauses.
The Vietnam War POWs
The Tap Code became widely known through its use by American prisoners of war held at the Hanoi Hilton (Hoa Lo Prison) during the Vietnam War. Air Force pilot Smitty Harris learned the code from a retired officer who taught it as a historical curiosity. After being shot down in 1965, Harris taught the Tap Code to fellow prisoners. The code spread throughout the prison camp and became the primary means of covert communication between isolated prisoners. Using knuckles, cups, brooms, or even coughs, prisoners could transmit messages through walls, floors, and ceilings. Former Senator John McCain, who spent 5½ years as a POW, later described the Tap Code as crucial for maintaining morale and command structure.
The Tap Code Grid
The 5×5 grid arranges 25 letters (C used for K) in five rows and five columns. To tap a letter, you first tap the row number (pausing briefly between each tap), pause longer, then tap the column number. A long pause separates one letter from the next. For example: A = row 1, column 1 = •/• (one tap, pause, one tap). H = row 2, column 3 = ••/••• (two taps, pause, three taps). S = row 4, column 3 = ••••/••• (four taps, pause, three taps).
Encoding Tips
In practice, prisoners developed shorthand: certain common words or phrases were abbreviated to save time and reduce noise. "GN" for "good night," "GBU" for "God bless you," and "SHF" for "same here friend" were common. The letters were tapped in bursts — experienced tappers could communicate several words per minute. When guards were near, prisoners might use very subtle signals: scraping a broom, coughing in patterns, or tapping fingernails almost silently on a shared wall.
Audio Simulation
This tool uses the Web Audio API to generate realistic tap sounds for your message. Each tap is a brief click sound generated in your browser without any network request. The speed control adjusts the tempo from slow (learning mode) to fast (practiced tapper speed). Try encoding a short message and listening to the audio to get a sense of how information was transmitted through prison walls.