Xerobit

Atbash Cipher Encoder and Decoder

The atbash cipher replaces each letter with its reverse-alphabet counterpart, so A becomes Z, B becomes Y, and so on. Because encoding and decoding use the same substitution, you only need one step to transform your text. Enter a message below to see the result instantly. Everything runs in your browser and nothing is uploaded.

Result

How to use the atbash cipher

  1. Type or paste your message into the Text field.
  2. The tool automatically applies the atbash cipher, swapping each letter for its mirror in the alphabet.
  3. Read the transformed output in the Result box below.
  4. Copy the result to use as an encoded message or decoded plaintext.

How the atbash cipher works

The atbash cipher is a monoalphabetic substitution cipher that maps each letter to its reverse position in the alphabet. The first letter becomes the last, the second becomes the second-to-last, and so on. Mathematically, if we assign A=0, B=1 through Z=25, the formula for any letter at position x is:

output = 25 - x

For example, the letter H is at position 7. Applying the formula gives 25 - 7 = 18, which corresponds to S. The letter E is at position 4, so 25 - 4 = 21, giving V. Therefore, "HELLO" becomes "SVOOL".

Because the operation is perfectly symmetrical, applying it twice returns the original text. Encoding and decoding are the exact same process, which makes the atbash cipher uniquely simple compared to other substitution methods like ROT13.

Alphabet mapping reference

The table below shows the complete substitution key used by the atbash cipher. Uppercase letters map to uppercase, and lowercase letters map to lowercase.

PlainCipherPlainCipherPlainCipher
AZJQSH
BYKPTG
CXLOUF
DWMNVE
EVNMWD
FUOLXC
GTPKYB
HSQJZA
IRRI

Notice that M and N map to each other, sitting exactly at the center of the 26-letter alphabet.

Historical origins

The atbash cipher originated as a Hebrew cipher, where the name itself describes the substitution: Aleph (first) maps to Tav (last), and Beth (second) maps to Shin (second-to-last). It appears in ancient texts, most notably in the Book of Jeremiah in the Hebrew Bible, where the word "Sheshach" is used as an atbash-encoded version of "Babel" (Babylon).

In the Hebrew alphabet, which has 22 letters, the principle is identical. The cipher was not designed for military-grade secrecy but rather as a scribal technique to obscure names or add layers of meaning to religious texts. Today, it remains a popular teaching tool for introducing the concept of substitution ciphers before moving on to more complex systems.

Handling numbers, spaces, and punctuation

The atbash cipher operates strictly on alphabetic characters. Numbers, spaces, punctuation marks, and symbols pass through completely unchanged. If you encode the string "Meet at 9:00 PM!", the result is "Nvvg zg 9:00 KN!". The digits and the exclamation mark stay exactly where they were.

This behavior preserves the structure and readability of sentences while hiding the actual words. However, it also means that word lengths and spacing patterns remain visible, which is one reason the cipher offers no real security against modern analysis. Non-Latin scripts such as Cyrillic or Greek are also left untouched, as the standard atbash algorithm only defines mappings for the 26 letters of the English alphabet.

Security and practical uses

As a cryptographic method, the atbash cipher provides zero security. Because there is only one possible key (the reversed alphabet), anyone who recognizes the pattern can decode the message instantly without needing a password or secret. Frequency analysis trivially breaks it, just as it does any simple substitution cipher.

Despite this, the atbash cipher sees regular use in puzzles, escape rooms, geocaching clues, and capture-the-flag cybersecurity challenges. It is also frequently used in software development as a basic exercise for learning string manipulation. For actual data protection, modern tools rely on algorithms like AES or hashing functions available in utilities such as a hash generator or Base64 encoding for safe data transport.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
Hello WorldText: Hello WorldSvool Dliow
Encoded messageText: Svool DliowHello World
Full alphabetText: ABCDEFGHIJKLMNOPQRSTUVWXYZZYXWVUTSRQPONMLKJIHGFEDCBA
Numbers and punctuationText: Test 123!Gvhg 123!

FAQ

What is the atbash cipher?

The atbash cipher is a substitution cipher that replaces every letter with its opposite in the alphabet. A becomes Z, B becomes Y, C becomes X, and so on.

Is encoding and decoding the same thing in atbash?

Yes. Because the alphabet is simply reversed, applying the cipher twice returns the original text. You use the exact same process to encode and decode.

Does the atbash cipher change numbers or punctuation?

No. Only letters from A to Z are transformed. Spaces, numbers, and punctuation marks remain exactly as they are in the original text.

Where did the atbash cipher come from?

It originated as a Hebrew cipher used by ancient scribes. The name comes from the first and last letters of the Hebrew alphabet: Aleph-Tav and Beth-Shin.

Is the atbash cipher secure for passwords or messages?

No. It has only one fixed key and is trivially easy to break. It should only be used for puzzles, games, or educational purposes.

Can I use the atbash cipher on other languages?

The standard implementation only supports the 26-letter Latin alphabet. Characters from other writing systems, including accented letters, are left unchanged.