Skip to content
MoneyDeck

Atbash Cipher

Encode and decode Atbash, the reverse-alphabet cipher (A↔Z, B↔Y)

Updated · Free, no signup

Result (encoded = decoded)

Svool, Dliow!

Letters substituted

10

Cipher alphabet

ABCDEFGHIJKLMNOPQRSTUVWXYZ → ZYXWVUTSRQPONMLKJIHGFEDCBA
  • Atbash is its own inverse: paste the result back in to get your original text.

Atbash substitution table

PlainCipherPlainCipher
AZNM
BYOL
CXPK
DWQJ
EVRI
FUSH
GTTG
HSUF
IRVE
JQWD
KPXC
LOYB
MNZA

About the Atbash Cipher

The Atbash cipher replaces each letter with the letter the same distance from the other end of the alphabet: A becomes Z, B becomes Y, C becomes X and so on, so HELLO turns into SVOOL. Because the mapping is its own reverse, the same operation both encodes and decodes, and this tool does either as you type.

Atbash began as a Hebrew cipher (aleph ↔ tav, bet ↔ shin, which gives it its name) and appears in the Book of Jeremiah. Today it is a favourite of puzzle hunts, escape rooms, geocaching, cryptography lessons and fan theories (the cartoon Gravity Falls hides Atbash messages in its end credits).

Atbash has no key, so it offers no real security: anyone who suspects it can reverse it in seconds. Use it for fun and learning only. Letters keep their case, numbers can optionally be mirrored (0↔9) and everything else, including spaces and punctuation, is left unchanged.

How to use the atbash cipher

  1. 1Type or paste plain text to encode, or Atbash text to decode.
  2. 2Choose whether digits should be mirrored too.
  3. 3Pick an output format: keep punctuation, uppercase, or groups of five.
  4. 4Copy the result; paste it back in at any time to reverse it.

Formula and method

E(x) = 25 − x (A = 0 … Z = 25); E(E(x)) = x

Number the letters A = 0, B = 1, … Z = 25. Atbash maps each letter x to 25 − x, so A (0) ↔ Z (25), B (1) ↔ Y (24), M (12) ↔ N (13). Applying the map twice gives 25 − (25 − x) = x, which is why encoding and decoding are the same operation. In affine-cipher terms Atbash is E(x) = (a·x + b) mod 26 with a = 25 and b = 25.

Upper- and lower-case letters keep their case. With the digits option, 0–9 are mirrored the same way (d ↦ 9 − d). Spaces, punctuation and other characters pass through unchanged unless you choose the grouped format, which strips them and writes the letters in blocks of five, the traditional way to present ciphertext so word lengths are hidden.

x
Position of the letter in the alphabet, A = 0 to Z = 25
E(x)
Position of the substituted letter

Worked examples

Encode a greeting

H→S, e→v, l→o, l→o, o→l gives "Svool", and W→D, o→l, r→i, l→o, d→w gives "Dliow". Case, the comma, space and exclamation mark are kept.

Decode a message

Running the ciphertext through Atbash again mirrors each letter back: G→T, S→H, V→E and so on, revealing THE QUICK BROWN FOX.

Traditional groups of five with digits

Meet → NVVG, at → ZG, 10 → 89 (1↔8, 0↔9) and pm → KN. Spaces are removed and the 10 characters are written as two blocks of five.

Frequently asked questions

How does the Atbash cipher work?+

Write the alphabet forwards and, under it, backwards. Each letter is replaced by the one beneath it: A↔Z, B↔Y, C↔X, D↔W, and so on until M↔N. Non-letters are left as they are.

How do you decode Atbash?+

Exactly the same way you encode it. Because each pair of letters swaps with each other, applying Atbash to the ciphertext restores the original message, so just paste the coded text into this tool.

Where does the name Atbash come from?+

It comes from the Hebrew alphabet: the first letter aleph (א) swaps with the last, tav (ת), and the second, bet (ב), with the second-last, shin (ש), giving A-T-B-Sh. It is used for a few words in the Book of Jeremiah, such as Sheshach for Babel.

Is the Atbash cipher secure?+

No. It has no key, so there is only one possible Atbash mapping and anyone can reverse it immediately, and like every simple substitution cipher it falls to letter-frequency analysis. Use it for puzzles and teaching, never to protect information.

What is the difference between Atbash and the Caesar cipher?+

A Caesar cipher shifts every letter forward by a fixed number (ROT13 shifts by 13), while Atbash reverses the alphabet. Both are monoalphabetic substitution ciphers; Atbash is a special case of the affine cipher with a = 25, b = 25.

Related tools