What Is the Atbash Cipher?
Atbash is a substitution cipher in which the alphabet is reversed: the first letter is replaced by the last, the second by the second-to-last, and so on. In English terms, A ↔ Z, B ↔ Y, C ↔ X — every letter maps to its mirror image at the opposite end of the alphabet. It is one of the oldest ciphers on record, with origins in Hebrew writing from around 500 BC, and its name comes from the first two swapped pairs of the Hebrew alphabet: aleph–tav (the first and last letters) and bet–shin (the second and second-to-last), contracted to "Atbash."
The cipher has no key. The substitution is fixed and public — there is nothing to choose or keep secret — which makes Atbash the simplest possible example of a substitution cipher. Its historical role was obfuscation rather than secrecy: it could hide the meaning of a name or phrase from a casual reader, but anyone who knew the trick could decode it immediately. That is also why it has aged so well: as a puzzle, a game mechanic, and a teaching example, it is still everywhere.
How Atbash Works
Number the alphabet from 1 (A) to 26 (Z). A letter and its Atbash mirror always add up to 27:
| Formula | Meaning |
|---|---|
| C = 27 − P | The mirror of the letter at position P sits at position 27 − P |
| P = 27 − C | Applying the same rule again restores the original letter |
Because the two formulas are identical, Atbash is its own inverse: encrypting twice returns the original text, and "decrypting" is literally the same operation as "encrypting." This tool exploits that property — typing on either side of the widget transforms the other side with the very same function.
Step-by-Step Example
Encode "HELLO WORLD" letter by letter, replacing each character with its mirror:
| Plain | H | E | L | L | O | W | O | R | L | D |
|---|---|---|---|---|---|---|---|---|---|---|
| Cipher | S | V | O | O | L | D | L | I | O | W |
H is the 8th letter, and 27 − 8 = 19, which is S. E is the 5th, and 27 − 5 = 22, which is V. Working
through the whole phrase gives SVOOL DLIOW. Try it above, then paste
SVOOL DLIOW into the Ciphertext box to watch it flip straight back to
HELLO WORLD.
Historical Notes
The most famous Atbash message in history appears in the Book of Jeremiah, where the city of Babylon is referred to as Sheshach. Writing the Hebrew spelling of Babel under Atbash produces Sheshach, and commentators have long read the passage as a deliberately obscured reference. The same technique is attested in the Talmud and in medieval Jewish literature. Elsewhere, variants of the idea — writing alphabets backwards, top to bottom — appear across cultures whenever someone wanted a phrase to require a moment's thought to read.
Example Reference Table
| Plain Text | Atbash |
|---|---|
| hello | svool |
| zinc | armx |
| abc xyz | zyx cba |
| SimplyCalculated | HrnkobXzoxfozgvw |
| The quick brown fox | Gsv jfrxp yildm ulc |
Paste any plain-text value into the tool to confirm the mirrored output, or paste a mirrored value into the Ciphertext box to confirm it decodes back. Every row demonstrates case preservation and the untouched spaces between words.
Strengths, Weaknesses, and Where It Fits
As a cipher, Atbash has one overwhelming weakness: there is no key, so there is nothing to guess. A single example or the knowledge that the alphabet is reversed is all an adversary needs. It also preserves letter frequencies, so it falls instantly to frequency analysis. Its real strengths are simplicity and ubiquity: no key to remember, trivially reversible by hand, and instantly recognizable to puzzle-solvers. In the wider cryptographic landscape, Atbash matters as the special case of the affine cipher with a = −1 and as a demonstration of what a substitution cipher is — the ancestor of everything from the Caesar cipher to modern block ciphers, and still a beloved staple of puzzle hunts, escape rooms, and games.
Troubleshooting & Common Mistakes
My decoded text has the wrong capitalization
Case is preserved exactly: "Hello" mirrors to "Svool", never "sVool" or "SVOOL". If a letter looks right but the case is off, the original text had that case — the cipher never changes it.
Some characters came through unchanged
That is correct. Atbash only transforms the 26 Latin letters; digits, punctuation, emoji, and non-Latin scripts pass through untouched. "2024! 🌍" encodes to "2024! 🌍".
I pasted ciphertext and got the same thing back
The only letter pairs that map to themselves are those in the exact middle of the alphabet: M and N (positions 13 and 14). If every letter round-tripped identically, check that you are not looking at the output field — typing in either box always writes the transformed result to the other box.
How This Cipher Compares to Other Classical Ciphers
Atbash is a fixed, keyless mirror of the alphabet — one of several classical ciphers covered on this site, each built on a different mechanism. Seeing them side by side makes it clear why a keyless substitution like Atbash offers even less protection than a shiftable one like Caesar.
| Cipher | Mechanism | What Makes It Different |
|---|---|---|
| Caesar Cipher | Substitution | Shifts every letter by one fixed number (the key) through the alphabet — the simplest classical substitution cipher. |
| Atbash Cipher (this page) | Substitution (fixed) | A special case of substitution with no key at all — it always mirrors the alphabet (A↔Z, B↔Y, ...). |
| Vigenère Cipher | Polyalphabetic substitution | Repeats a keyword to shift each letter by a different amount, defeating simple frequency analysis that breaks Caesar. |
| Beaufort Cipher | Polyalphabetic substitution (reciprocal) | A variant of Vigenère's idea that is self-reciprocal — the same operation both encrypts and decrypts. |
| Playfair Cipher | Digraph substitution | Encrypts letters two at a time using their positions in a 5×5 key square — the first practical digraph cipher (1854). |
| Affine Cipher | Mathematical substitution | Encrypts using a linear function (ax + b mod 26) with two keys instead of one shift value. |
| ROT47 | Substitution (extended range) | Applies a Caesar-style shift across the full printable ASCII range, not just letters — used to obfuscate text online (e.g. spoilers), not for security. |
| Rail Fence Cipher | Transposition | Rearranges letter order in a zigzag pattern instead of substituting letters — a fundamentally different technique from every cipher above. |
| A1Z26 | Encoding (not a cipher) | Simply maps each letter to its position number (A=1...Z=26) — a puzzle/encoding convention, not intended for real secrecy. |
| NATO Phonetic Alphabet | Encoding (not a cipher) | Replaces each letter with a spoken code word (Alfa, Bravo, Charlie…) for reliable voice transmission on noisy radios — built for clarity, not secrecy. |