Atbash Cipher — Mirror Alphabet Encoder

Encode or decode text using the ancient Hebrew mirror cipher. A becomes Z, B becomes Y — symmetric and self-reversing.

⚙️ atbash Tool

Replace each letter with its mirror in the alphabet — A becomes Z, B becomes Y.
ℹ️ Classic Hebrew mirror cipher. Symmetric mapping: A ⟷ Z, B ⟷ Y, C ⟷ X.

Atbash Mirror Mapping Table:

Plain
A
B
C
D
E
F
G
H
I
J
K
L
M
Cipher
Z
Y
X
W
V
U
T
S
R
Q
P
O
N

What Is the Atbash Cipher?

The Atbash cipher is one of the oldest known encryption methods, dating back to approximately 600-500 BCE. Originally designed for the Hebrew alphabet, it is a monoalphabetic substitution cipher that works by mirroring the alphabet — the first letter is swapped with the last, the second with the second-to-last, and so on. When adapted to the English alphabet, A maps to Z, B maps to Y, C maps to X, and the pattern continues symmetrically through the entire alphabet.

The name "Atbash" is itself a description of the cipher technique. It comes from the Hebrew letters Aleph-Tav-Beth-Shin: Aleph (first letter) pairs with Tav (last letter), and Beth (second letter) pairs with Shin (second-to-last letter). This mnemonic naming convention elegantly captures the entire algorithm in a single word.

Historical Significance

The most famous use of the Atbash cipher appears in the Hebrew Bible. In the Book of Jeremiah (chapters 25:26 and 51:41), the prophet encodes the word "Babel" (Babylon) as "Sheshach" using the Hebrew Atbash mapping. Scholars debate whether this was done for mystical reasons — a form of sacred encoding common in Kabbalistic tradition — or for political caution, avoiding directly naming the Babylonian empire that had conquered Judah.

The cipher is also associated with Jewish mysticism and Kabbalah, where letter transformations carry spiritual significance. In Kabbalistic tradition, the Atbash cipher is one of three classical Hebrew ciphers, alongside Albam (shifting by 13 positions in the 22-letter Hebrew alphabet) and Atbah (a more complex permutation). These transformations were used to discover hidden meanings in Torah texts.

Mathematical Properties

The Atbash cipher has an elegant mathematical structure. For an alphabet of size N (26 for English), the mapping function is: f(x) = (N - 1) - x, where x is the zero-based position of the letter. This function is an involution — applying it twice yields the original value: f(f(x)) = (N-1) - ((N-1) - x) = x. This self-inverse property means the same operation both encrypts and decrypts, similar to ROT13 but achieved through a completely different mapping.

An interesting consequence of the mirror mapping is that exactly one letter (if N is odd) or zero letters (if N is even) map to themselves. In the 26-letter English alphabet, no letter maps to itself — every letter changes. In the 22-letter Hebrew alphabet, also no letter is fixed. This contrasts with ROT13, where similarly no letter maps to itself, but the two ciphers produce entirely different substitution tables.

Modern Uses

Today the Atbash cipher serves primarily as an educational tool and puzzle element. It appears frequently in geocaching challenges, where cache owners use it to encode coordinates or clue words. Escape room designers favor it for its simplicity and the satisfying visual pattern of the mirror alphabet. The cipher is also a standard topic in introductory cryptography courses, illustrating concepts of substitution, involution, and the difference between ciphers with and without keys.

In popular culture, the Atbash cipher gained wider recognition through Dan Brown's novel The Da Vinci Code, where it plays a role in solving one of the story's puzzles. The cipher's ancient Hebrew origins and association with biblical mysteries make it a compelling narrative device, even though its cryptographic strength is effectively zero by modern standards.

Atbash vs. Other Simple Ciphers

Among the family of simple substitution ciphers, Atbash is unique in having no variable key. The Caesar cipher has 25 possible shifts, the Vigenere cipher uses a keyword of arbitrary length, and even ROT13 can be seen as a specific key choice (shift=13). Atbash, by contrast, is entirely deterministic — there is only one Atbash mapping for any given alphabet. This makes it the simplest possible substitution cipher but also the least secure, since any attacker who recognizes the technique can immediately decode the message.

Frequently Asked Questions

Related Tools