Skip to content
CodeShift
Menu

Atbash Cipher — Encoder & Decoder

Atbash mirrors the alphabet — A becomes Z, B becomes Y — so the same step encodes and decodes. Type in either box.

Standard: Classical substitution cipher (A–Z)Reviewed October 2026 · by The CodeShift DeskHow we translate
PlaintexttoAtbash
Mirror alphabet
PlainABCDEFGHIJKLMNOPQRSTUVWXYZ
AtbashZYXWVUTSRQPONMLKJIHGFEDCBA

How Atbash works

Write the alphabet forwards, then write it backwards underneath. Each letter is replaced by the one below it:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
ZYXWVUTSRQPONMLKJIHGFEDCBA

The thirteen pairs are A ↔ Z, B ↔ Y, C ↔ X, D ↔ W, E ↔ V, F ↔ U, G ↔ T, H ↔ S, I ↔ R, J ↔ Q, K ↔ P, L ↔ O, M ↔ N. Because every pair swaps both ways, Atbash is its own inverse — encoding a message twice gives back the original — which is why this tool uses the same function for both boxes. In arithmetic terms, a letter at position p (A = 1 … Z = 26) becomes the letter at position 27 − p.

Worked example: WIZARD

LetterPosition27 − positionAtbash
W234D
I918R
Z261A
A126Z
R189I
D423W

WIZARD becomes DRAZIW — a neat example, because the result is the original word reversed. Puzzle-setters love finding words like this. Upper and lower case are preserved, and spaces, digits and punctuation pass through unchanged, so “Wizard of Oz” becomes “Draziw lu La”.

Origins: a Hebrew cipher

Atbash began with the Hebrew alphabet. Its name spells out the first swaps: aleph (the first letter) with tav (the last), and bet (the second) with shin (the second-to-last). Scholars identify a few likely uses in the Hebrew Bible, the best known in the Book of Jeremiah, where the name “Sheshach” (Jeremiah 25:26 and 51:41) reads as Babel, Babylon, once Atbash is applied to the Hebrew letters. Jewish commentators such as Rashi recognised it, and a survey by Scott Noegel of the University of Washington describes Jeremiah 25:26, 51:1 and 51:41 as the three sure instances (Jewish Bible Quarterly, 1996). The English version used here simply applies the same mirror idea to the 26 Latin letters.

Atbash, Caesar and other substitution ciphers

Atbash is a monoalphabetic substitution: every plaintext letter always maps to the same ciphertext letter. So is the Caesar cipher, but Caesar slides the alphabet along while Atbash flips it; of the 26 possible Caesar shifts, none reproduce Atbash. Both fall instantly to frequency analysis, and Atbash has no key at all, so once someone guesses the method the message is open.

Using Atbash in puzzles

  • Escape rooms and treasure hunts: Atbash is easy to decode with a printed mirror alphabet, so it suits younger players.
  • Spotting it: if a ciphertext has many Z, V and R letters, try Atbash — they are the mirrors of the common letters A, E and I.
  • Layering: combine Atbash with the A1Z26 letter-to-number cipher or Morse code for a multi-step puzzle.

Decoding Atbash by hand

  1. Write A–M in a row and N–Z underneath it in reverse (Z under A, Y under B … N under M).
  2. For each cipher letter, find it in either row and write down the letter directly above or below it.
  3. Leave spaces, digits and punctuation as they are.

Common short words are a quick way to confirm you are looking at Atbash:

PlainTHEANDYOUARESECRET
AtbashGSVZMWBLFZIVHVXIVG

The maths: Atbash as an affine cipher

Number the letters A = 0 to Z = 25. Atbash sends a letter at position x to 25 − x. Written as a formula that is E(x) = (25x + 25) mod 26, which makes Atbash a special case of the affine cipher, E(x) = (ax + b) mod 26, with a = b = 25. Applying it twice gives 25 − (25 − x) = x, which is why encoding and decoding are the same operation. Because 26 is even, no letter is its own mirror: every letter changes, so a message in Atbash never contains a plaintext letter in its original place.

Frequently asked questions

How do I decode an Atbash cipher?+

Exactly the same way you encode it. Atbash swaps A with Z, B with Y and so on, so applying it twice returns the original: HELLO → SVOOL → HELLO. Paste the ciphertext into either box.

Does Atbash have a key?+

No. There is only one Atbash alphabet, so anyone who recognises the cipher can read it. That makes it a fun puzzle rather than a way to keep secrets.

Is Atbash a type of Caesar cipher?+

No. A Caesar cipher shifts the alphabet; Atbash reverses it. Of the 26 possible Caesar shifts, none produces the Atbash alphabet, though both are simple substitution ciphers.

Where does the name Atbash come from?+

It comes from Hebrew: the first letter aleph is swapped with the last, tav, and the second, bet, with the second-to-last, shin — a-t-b-sh.

More translators