Skip to content
Also from us: TypologyOnline.com · Free personality tests

Tap Code Cipher: When Letters Became Knocks

How a 5×5 square turned the alphabet into row-and-column tap groups, and made communication possible through walls, pipes, floors, and silence.

Try the Tap Code Cipher tool
Illustration of a Tap Code square turning letters into rows and columns of knocks
Tap Code turns each letter into counted row and column taps, making language possible through the smallest physical signals.

The Tap Code is one of the easiest ciphers to understand, and one of the most powerful to imagine. No paper. No pencil. No radio. No visible writing. No spoken words. Just taps.

A letter becomes two numbers: a row and a column. The row is tapped first, then there is a pause, then the column is tapped. A longer pause separates one letter from the next. So the letter T, which sits at row 4, column 4 in the standard Tap Code square, becomes .... .... or, in compact digit form, 44.

The Tap Code takes the old Polybius-square principle, turning letters into grid coordinates, and makes it physical. The alphabet becomes something you can knock through a wall, tap on a pipe, or pass through a surface when ordinary communication is impossible.

That gives Tap Code a different feeling from many classical ciphers. Caesar shifts letters. Atbash mirrors letters. Affine calculates letters. Tap Code knocks letters.

It is not secure by modern standards. Anyone who knows the square can read it. But security is not the only reason a cipher matters. Sometimes the real problem is not how to hide a message from a powerful attacker. Sometimes the problem is how to send anything at all.

That is where the Tap Code earns its place. It turns a tiny channel, a knock, a pause, another knock, into language.

Tap Code Cipher at a glance

Feature Tap Code Cipher
Type Tap encoding / signalling cipher
Family Polybius square family
Main idea Each letter becomes row taps followed by column taps
Grid 5 x 5 square
Shared cell C/K share row 1, column 3
Standard format Dotted taps, such as .... ....
Compact format Digit pairs, such as 44
Example T = row 4, column 4 = .... .... or 44
Decryption Count the row group, count the column group, then look up the square
Security Not secure if the system is known
Best use Learning coordinate ciphers, signalling, Polybius-square logic, and constrained communication

The Tap Code is best understood as row first, column second. So 23 means row 2, column 3. In the standard square, row 2, column 3 is H, so 23 = H.

In dotted tap form, the same letter is:

.. ...

Two taps give the row. Three taps give the column.

What is the Tap Code Cipher?

The Tap Code Cipher is a grid-based way of representing letters as tap groups. It uses a 5 x 5 square, with the alphabet written into the grid.

Because the English alphabet has 26 letters but a 5 x 5 square has only 25 cells, one pair of letters has to share a position. In the standard Tap Code, C and K share the same cell.

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

Each letter now has a coordinate. The letter A is in row 1, column 1, so it becomes 11. The letter H is in row 2, column 3, so it becomes 23. The letter T is in row 4, column 4, so it becomes 44.

In compact written form, these are digit pairs. In physical Tap Code form, those same numbers become groups of taps.

Letter Row Column Compact digits Dotted taps
A 1 1 11 . .
H 2 3 23 .. ...
T 4 4 44 .... ....
Z 5 5 55 ..... .....

The code is simple because the receiver only needs to count.

How does the Tap Code work?

Tap Code has three main stages:

  1. Put the alphabet into a 5 x 5 square.
  2. Convert each letter into its row and column.
  3. Send the row and column as tap groups.

Using the standard 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 encode HELLO, find each letter in the square:

Letter Coordinate Dotted taps
H 23 .. ...
E 15 . .....
L 31 ... .
L 31 ... .
O 34 ... ....

So:

HELLO -> 23 15 31 31 34

or:

HELLO -> .. ... / . ..... / ... . / ... . / ... ....

The slash between letters is not part of the original physical code. It is a useful written separator, because Tap Code depends heavily on timing and grouping.

Key and rules

The standard Tap Code has no secret key. Its structure is the shared square.

Rule Explanation
Use a 5 x 5 square The alphabet is arranged into 25 cells
Share C and K The standard Tap Code combines C/K in one cell
Encode row first The first tap group gives the row
Encode column second The second tap group gives the column
Use pauses A short pause separates row and column; a longer pause separates letters
Preserve word breaks if desired Tools may use // to show a space between words
Decode by counting Count taps, find row and column, then read the letter

The C/K sharing is the main alphabet detail. If the sender means K, they use the same cell as C. The receiver decides from context whether the intended letter was C or K.

For example:

13 11 44

could be read as:

CAT

or, in another context:

KAT

The grid does not know which one was intended. The human reader supplies the context.

Worked example: MEET AT DAWN

Encode:

MEET AT DAWN

Using the standard 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

First encode each word.

Letter Coordinate Dotted taps
M 32 ... ..
E 15 . .....
E 15 . .....
T 44 .... ....

So:

MEET -> 32 15 15 44

The next word:

Letter Coordinate Dotted taps
A 11 . .
T 44 .... ....

So:

AT -> 11 44

The final word:

Letter Coordinate Dotted taps
D 14 . ....
A 11 . .
W 52 ..... ..
N 33 ... ...

So:

DAWN -> 14 11 52 33

Put it together with word breaks:

MEET AT DAWN -> 32 15 15 44 // 11 44 // 14 11 52 33

In dotted tap form:

... .. / . ..... / . ..... / .... .... // . . / .... .... // . .... / . . / ..... .. / ... ...

This is the Tap Code doing exactly what it promises. Letters become coordinates, and coordinates become tap groups.

Using the CipherRegister Tap Code tool

The Tap Code tool lets you explore the same mapping in a readable way.

Control What it does
Encrypt as compact Shows coordinates such as 23 15 31 31 34
Encrypt as dotted taps Shows tap groups such as .. ...
Decode Converts compact or dotted tap input back into letters
Preserve word breaks Uses // to show spaces between words
Tap playback Plays the taps so the rhythm can be heard
Playback speed Controls how quickly the taps are played
Tap code square Shows the 5 x 5 grid used for lookup

The compact form is easier to copy and check. The dotted form is closer to the real physical code. Playback helps make the pauses and rhythm easier to understand.

Why C and K share a cell

A 5 x 5 square has:

5 x 5 = 25

The English alphabet has 26 letters. To make the alphabet fit, traditional Tap Code combines C and K:

C/K = 13

This differs from the Polybius Square and Playfair cipher, which usually combine I and J. Tap Code traditionally uses the C/K convention instead.

That means:

Letter Coordinate
C 13
K 13

The receiver uses context to decide which one makes sense.

Decrypting Tap Code

Decryption is counting in reverse.

Take this compact message:

23 15 31 31 34

Read each pair:

Pair Row Column Letter
23 2 3 H
15 1 5 E
31 3 1 L
31 3 1 L
34 3 4 O

So:

23 15 31 31 34 -> HELLO

Now take the dotted form:

.. ... / . ..... / ... . / ... . / ... ....

Count each group:

Dotted taps Counts Letter
.. ... 2, 3 H
. ..... 1, 5 E
... . 3, 1 L
... . 3, 1 L
... .... 3, 4 O

The only real trick is grouping. If the pauses are unclear, the message becomes ambiguous.

What leaks from Tap Code?

Tap Code is not strong encryption. If someone recognises the system, the message can be decoded quickly.

Several things leak:

Leakage Why it matters
Known square The standard Tap Code square is public
Fixed coordinates Each letter always has the same coordinate
Word breaks Preserved // separators reveal word structure
Rhythm Tap counts reveal row and column values directly
C/K ambiguity One cell represents two letters

If T always becomes 44, then 44 behaves like T. If E always becomes 15, then 15 behaves like E. This is the same basic weakness as a simple substitution cipher.

Tap Code is excellent for signalling and teaching. It is not suitable for private modern communication.

History and use

Tap Code is strongly associated with prisoners communicating through walls, pipes, floors, or other barriers. It became especially famous through prisoner-of-war stories, where people used taps to pass letters when speech or writing was restricted.

The exact historical details vary by setting, but the underlying reason is easy to understand: Tap Code can survive with almost no channel at all. A sound, a knock, a pause, and another knock can carry a letter.

That makes it different from many ciphers. A Caesar cipher assumes written text. Morse code assumes short and long signals. Tap Code can be improvised with only countable impacts.

Its importance is therefore practical and human, not cryptographically strong.

Tap Code vs Polybius Square

Tap Code and the Polybius Square are close relatives.

Feature Polybius Square Tap Code
Main idea Letters become coordinates Coordinates become tap groups
Standard square Usually I/J shared Usually C/K shared
Output Digit pairs such as 23 Tap groups such as .. ...
Use Encoding and cipher building block Physical signalling
Security Weak by itself Weak by itself

Polybius turns the alphabet into row-and-column coordinates. Tap Code turns those coordinates into sound.

Tap Code vs Morse Code

Tap Code and Morse code are both signalling systems, but they work differently.

Feature Tap Code Morse code
Basic unit Counted tap groups Short and long signals
Structure Row and column coordinates Letter-specific dot/dash patterns
Grid needed Yes No
Easy to improvise Yes, because counting taps is enough Yes, but timing distinctions matter more
Efficiency Often slower Usually faster

Tap Code is often easier to teach quickly because every letter follows the same pattern: row first, column second.

Morse is more efficient, but it requires learning a separate dot/dash pattern for each letter.

System Relationship
Polybius Square The coordinate idea behind Tap Code
Playfair cipher Also uses a 5 x 5 square, but encrypts letter pairs
Bifid cipher Splits and recombines Polybius coordinates
ADFGX cipher Uses coordinate labels and transposition
Morse code Another signal-friendly communication system
A1Z26 Another simple way to turn letters into numbers

Tap Code belongs to the coordinate family, but its special role is physical communication.

A simple Python Tap Code encoder

The code below implements a small educational Tap Code encoder and decoder. It supports compact digit pairs and dotted tap groups.

Python exampleShow code
TAP_CODE_SQUARE = [
    ["A", "B", "C", "D", "E"],
    ["F", "G", "H", "I", "J"],
    ["L", "M", "N", "O", "P"],
    ["Q", "R", "S", "T", "U"],
    ["V", "W", "X", "Y", "Z"],
]


def build_maps():
    """
    Build lookup maps for the standard Tap Code square.

    C and K share coordinate 13.
    """
    encode_map = {}
    decode_map = {}

    for row_index, row in enumerate(TAP_CODE_SQUARE):
        for col_index, letter in enumerate(row):
            coordinate = str(row_index + 1) + str(col_index + 1)
            encode_map[letter] = coordinate
            decode_map[coordinate] = letter

    encode_map["K"] = encode_map["C"]
    decode_map["13"] = "C/K"

    return encode_map, decode_map


def coordinate_to_dots(coordinate):
    """
    Convert a coordinate such as 44 into dotted tap groups.
    """
    row = int(coordinate[0])
    col = int(coordinate[1])

    return "." * row + " " + "." * col


def dots_to_coordinate(token):
    """
    Convert dotted tap groups such as .... .... into a coordinate.
    """
    parts = token.split()

    if len(parts) != 2:
        raise ValueError("Each dotted tap token must contain row and column groups.")

    row = len(parts[0])
    col = len(parts[1])

    if not (1 <= row <= 5 and 1 <= col <= 5):
        raise ValueError("Tap counts must be between 1 and 5.")

    return str(row) + str(col)


def tap_code_encode(text, dotted=False):
    """
    Encode text as Tap Code.

    Spaces become // so word breaks remain visible.
    """
    encode_map, decode_map = build_maps()
    output = []

    for char in text.upper():
        if char.isalpha():
            coordinate = encode_map[char]

            if dotted:
                output.append(coordinate_to_dots(coordinate))
            else:
                output.append(coordinate)
        elif char.isspace():
            output.append("//")

    separator = " / " if dotted else " "
    return separator.join(output)


def tap_code_decode(code):
    """
    Decode compact Tap Code coordinates.
    """
    encode_map, decode_map = build_maps()
    output = []

    for token in code.split():
        if token == "//":
            output.append(" ")
        elif token in decode_map:
            output.append(decode_map[token])
        else:
            output.append("?")

    return "".join(output)


# Example
message = "MEET AT DAWN"

compact = tap_code_encode(message)
dotted = tap_code_encode(message, dotted=True)
decoded = tap_code_decode(compact)

print("Message :", message)
print("Compact :", compact)
print("Dotted  :", dotted)
print("Decoded :", decoded)

Expected output:

Message : MEET AT DAWN
Compact : 32 15 15 44 // 11 44 // 14 11 52 33
Dotted  : ... .. / . ..... / . ..... / .... .... / // / . . / .... .... / // / . .... / . . / ..... .. / ... ...
Decoded : MEET AT DAWN

The important idea is visible in this line:

return "." * row + " " + "." * col

The coordinate is not merely written down. It becomes a counted physical signal.

Common questions about Tap Code

Is Tap Code secure?

No. Tap Code is not secure if the system is known. It is a signalling code and educational cipher, not modern encryption.

Why do C and K share a cell?

A 5 x 5 grid has 25 cells, but the English alphabet has 26 letters. Traditional Tap Code combines C and K in the same cell:

C/K = 13

The receiver uses context to decide whether the intended letter is C or K.

How do you tap the letter T?

In the standard Tap Code square, T is at row 4, column 4. So T is:

44

In dotted tap form:

.... ....

That means four taps for the row, a pause, and then four taps for the column.

How do you encode HELLO in Tap Code?

Using the standard square:

Letter Pair Dotted taps
H 23 .. ...
E 15 . .....
L 31 ... .
L 31 ... .
O 34 ... ....

So:

HELLO -> 23 15 31 31 34

or:

HELLO -> .. ... / . ..... / ... . / ... . / ... ....

What does // mean in Tap Code output?

On CipherRegister, // can be used to preserve word breaks. For example:

MEET AT DAWN -> 32 15 15 44 // 11 44 // 14 11 52 33

The // symbols are not letters. They simply mark the spaces between words.

Is Tap Code the same as Morse code?

No. Tap Code represents each letter as a row-and-column pair in a 5 x 5 square. Morse code represents each letter as a pattern of short and long signals.

Tap Code is often easier to improvise by knocking because it mostly requires counting groups of taps. Morse code is usually more efficient, but it depends on distinguishing short and long signal lengths.

Why does decoding fail if separators are unclear?

Because Tap Code depends on grouping. For example:

.... ....

is clearly:

44 = T

But if you remove the pause or separator:

........

the meaning becomes unclear. The taps themselves are not enough. The grouping carries the structure.

Why the Tap Code still matters

The Tap Code should not be used to protect serious secrets. Not passwords. Not private messages. Not financial information. Not API keys. Not recovery phrases. Not personal data.

It has no modern cryptographic strength. Its standard square is known, its signals are visible or audible, and its messages can be decoded easily once the system is recognised.

But it still earns its place.

It shows how letters can become coordinates. It shows how coordinates can become sound. It shows why pauses and separators matter. It shows why a communication channel does not need to be rich to be meaningful.

It also shows why a code can be weak as encryption but powerful as a human tool.

Sometimes the first victory is not secrecy. Sometimes the first victory is contact.

A tap on a wall. A reply from the other side. A message crossing a barrier.

Caesar turns letters into shifts. Atbash turns letters into mirrors. Affine turns letters into arithmetic. Tap Code turns letters into knocks.

That is why the Tap Code still matters. Not because it is strong. Because it shows how little is needed for language to survive.

Try the Tap Code tool

Open the Tap Code tool and try a simple message such as:

HELLO

You can view it as compact digit pairs:

23 15 31 31 34

or as dotted tap groups:

.. ... / . ..... / ... . / ... . / ... ....

Then try a longer phrase:

MEET AT DAWN

which becomes:

32 15 15 44 // 11 44 // 14 11 52 33

Use the tool to compare compact digits, dotted taps, preserved word breaks, C/K ambiguity, playback, and the underlying 5 x 5 square.

Sources and further reading

Try the Tap Code Cipher Tool

Want to experiment with the idea in practice? Open the matching tool and try your own text.

Open Tap Code Cipher
Signal acquired

A note from the team

We build these tools because we love cryptography, encoding, and making difficult ideas easier to explore. If they've helped you, even a small coffee means the world to the project. Thank you!

Say thanks on Ko-fi

Read next

Coordinate Ciphers Polybius Square Cipher: Turning Letters into Coordinates How a 5×5 grid turned the alphabet into numbers, signals, and one of classical cryptography's most useful building blocks. Signal Encoding Morse Code: The Moment Messages Escaped the Horse How dots, dashes, and disciplined timing helped build the first electric language of the modern world. Letter-Number Encoding A1Z26 Cipher: The Mechanics of Simple Substitution How replacing letters with their alphabet positions teaches symbolic transformation, reversibility, and the limits of simple secrecy.
Back to all articles