Skip to content

↑↓ navigate ↵ open Esc close Search runs locally

Atbash Cipher Encoder & Decoder

Encode or decode the Atbash cipher, which swaps each letter with its mirror in the alphabet: A with Z, B with Y, and so on. The same operation encodes and decodes.

  • Runs in your browser
  • Nothing is uploaded
  • Free, no sign-up
The same operation encodes and decodes
0 chars
Atbash
Runs in your browser. Nothing is uploaded. Tip: run it twice to get the original back

How to use the Atbash cipher tool#

  1. Type or paste your text into the left box. The Atbash result appears on the right as you type.
  2. To decode, paste Atbash text the same way: the mirror of a mirror is the original.
  3. Letter case, digits, spaces and punctuation are kept as they are.
  4. Copy the result, or compare it with ROT13 and the other variants under the tool.

Examples#

Encode a greeting

Input
Hello, World!
Output
Svool, Dliow!

H is the 8th letter and S is the 8th from the end, so they swap.

A word that reads backwards

Input
wizard
Output
draziw

A famous coincidence: the Atbash of "wizard" is "wizard" spelled backwards.

Decode Atbash

Input
Svool, Dliow!
Output
Hello, World!

Applying Atbash again returns the original text.

What is the Atbash cipher?#

Atbash is a substitution cipher that reverses the alphabet: the first letter swaps with the last, the second with the second-to-last, and so on. In English, A becomes Z, B becomes Y and M becomes N. Because every pair simply swaps places, encoding and decoding are the same operation.

Atbash is one of the oldest known ciphers. It was first used with the Hebrew alphabet, and its name comes from the letters that swap: aleph with tav, and bet with shin (A-T-B-Sh). Scholars have pointed to it in the Book of Jeremiah, where the word "Sheshach" is read as the Atbash form of "Babel".

The Atbash table#

PlainABCDEFGHIJKLM
AtbashZYXWVUTSRQPON

The table works both ways: N to Z map back to M to A. As a formula, a letter at position x (A = 0) becomes 25 − x.

Atbash vs Caesar and ROT13#

CaesarROT13Atbash
How letters moveShift forward by NShift forward by 13Mirror the alphabet
Keys25NoneNone
Self-inverseOnly for N = 13YesYes
Hello becomesKhoor (N = 3)UryybSvool

In mathematical terms, Atbash is an affine cipher with E(x) = (25x + 25) mod 26, while the Caesar cipher is the affine cipher E(x) = (x + n) mod 26.

Atbash offers no security. There is no key at all, so anyone who knows the method can read the message. It is used today in puzzles, escape rooms, games and teaching.

Atbash in code#

JavaScript#

javascript
const atbash = (s) =>  s.replace(/[a-z]/gi, (c) => {    const base = c <= 'Z' ? 65 : 97;    return String.fromCharCode(base + 25 - (c.charCodeAt(0) - base));  }); atbash('Hello, World!'); // "Svool, Dliow!"

Python#

python
import string table = str.maketrans(    string.ascii_lowercase + string.ascii_uppercase,    string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1],)'Hello, World!'.translate(table)   # 'Svool, Dliow!'

Command line#

bash
echo 'Hello, World!' | tr 'A-Za-z' 'ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba'

Common errors and fixes#

  • The decoded text is still unreadable

    The message was probably encoded with a different cipher. Check ROT13 and ROT47 in the variants panel, or try the Caesar cipher solver, which tests every shift.

  • Digits did not change

    Classic Atbash only mirrors letters. Digits, spaces and punctuation are always kept.

  • Accented letters such as é were not changed

    This tool mirrors the 26 basic Latin letters, as standard Atbash does. Other alphabets have their own Atbash tables.

Frequently asked questions#

How do I decode Atbash?

Apply Atbash again. Each letter swaps with its mirror, and swapping twice returns the original letter.

Where does the name Atbash come from?

From the Hebrew alphabet: aleph swaps with tav and bet with shin, giving A-T-B-Sh.

Is Atbash the same as ROT13?

No. ROT13 shifts every letter forward by 13 places, while Atbash mirrors the alphabet. Both are self-inverse, but they give different results: "Hello" is "Uryyb" in ROT13 and "Svool" in Atbash.

Does Atbash have a key?

No. There is only one Atbash table for each alphabet, which is why it is easy to break.

Is my text uploaded?

No. Everything runs in your browser.

Your next tool is one search away.

Free, private developer tools that run in your browser. No signup, nothing uploaded, no waiting.

Browse all tools

Tip: press Ctrl D to bookmark dev247.