T

Text Machine

Powerful text tools, in your browser

Atbash Cipher

Encode and decode the Atbash cipher, the ancient mirror cipher that swaps A with Z, B with Y, and so on. Because the mapping is symmetric, the same box both encrypts and decrypts. Everything runs in your browser.

Atbash is its own inverse — the same operation both encodes and decodes, so one box does both.

Your text
Atbash result

Enter text above to see the Atbash result here.

Atbash alphabet table

Plain

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z

Atbash

Z
Y
X
W
V
U
T
S
R
Q
P
O
N
M
L
K
J
I
H
G
F
E
D
C
B
A

How to use Atbash Cipher

  1. 1

    Type or paste your text

    Enter the message you want to convert. The Atbash cipher runs automatically as you type, mirroring each letter while numbers and punctuation pass through.

  2. 2

    Read the Atbash result

    Your converted text appears instantly. Because Atbash is its own inverse, the same result box works whether you are encoding plain text or decoding a coded message.

  3. 3

    Check the alphabet table

    Open the Atbash alphabet table to see the full A to Z over Z to A mapping and confirm how each letter is swapped.

  4. 4

    Copy, download, or share

    Copy the result to your clipboard, download it as a text file, or share a link that reopens the tool with your exact text ready to go.

Understanding the Atbash Cipher

What is the Atbash cipher?

The Atbash cipher is a simple substitution cipher that replaces each letter with its mirror image in the alphabet: A becomes Z, B becomes Y, C becomes X, and so on down to Z becoming A. It is one of the oldest ciphers known, originally created for the Hebrew alphabet, and its name comes from the first two letter pairs it swaps, Aleph with Taw and Beth with Shin.

Because the alphabet is simply reversed, Atbash has no key to choose and no settings to adjust. That makes it the easiest classical cipher to learn and a common sight in puzzles, escape rooms, geocaching, and beginner cryptography lessons.

How the Atbash cipher works

To encode, you write the alphabet forwards and then again backwards underneath it, lining A up with Z, B with Y, and M with N in the middle. Every letter in your message is then swapped for the letter sitting below it. Spaces, digits, and punctuation are left exactly as they are, so the word shape and length of the original message stay visible.

Atbash is its own inverse: running text through it a second time brings back the original, so the same single operation both encrypts and decrypts. There is no separate decode step and no key to remember, which is exactly what makes it so quick to use.

Worked example

Take the word HELLO. H maps to S, E maps to V, L maps to O, and O maps to L, giving the ciphertext SVOOL. Run SVOOL back through Atbash and you get HELLO again. A longer phrase behaves the same way: ATTACK AT DAWN becomes ZGGZXP ZG WZDM, with the spaces left in place so the three words remain clearly separated.

Notice that repeated letters always map to the same substitute, so the double L in HELLO becomes a double O. That fixed one-to-one mapping is what defines a monoalphabetic substitution cipher.

The Atbash table and formula

The whole cipher fits in one small table: the plain row A to Z over a cipher row Z to A. If letters are numbered from 0 to 25, with A as 0 and Z as 25, the rule is simply E(x) = 25 - x, and because applying it twice returns the original number, the very same formula decodes. The reference table below the tool shows the complete mapping at a glance.

Atbash in Hebrew and the Bible

Atbash was first used with the 22-letter Hebrew alphabet, pairing the first letter Aleph with the last letter Taw, the second letter Beth with the second-to-last Shin, and so on. Scholars have long noted apparent examples in the Hebrew Bible: in the Book of Jeremiah the name Sheshach is widely read as an Atbash encoding of Babel, meaning Babylon, and Leb Kamai is read as an encoding of Kasdim, the Chaldeans. Whether these were deliberate ciphers or wordplay is still debated, but they show the technique is at least two and a half thousand years old.

How to recognise and break Atbash

Atbash offers no real security: there is only one possible mapping, so anyone who suspects Atbash can decode a message instantly by running it through the cipher again. A useful clue is that the letter A in the plaintext always becomes Z, and short common words take on recognisable shapes, for example the word A becomes Z and the word I becomes R. Because the cipher reverses letter frequencies, the letters that are normally rare in English, such as Z and Q, suddenly appear as often as common letters do, which is a quick giveaway that a reverse-alphabet cipher is in play.

Is the Atbash cipher secure?

No. With a single fixed mapping and no key, Atbash provides no protection for anything that genuinely needs to stay secret, and it is solved the instant it is recognised. Its value today is educational and recreational: it is a perfect first cipher for teaching substitution, a fun tool for puzzles and games, and a piece of cryptographic history. For real security, modern algorithms such as AES are used instead.

Frequently asked questions

What is the Atbash cipher?
Atbash is one of the oldest substitution ciphers. It replaces each letter with its mirror in the alphabet, so A becomes Z, B becomes Y, and so on. It was originally devised for the Hebrew alphabet, and its name comes from the first two pairs it swaps: Aleph with Taw and Beth with Shin.
How does the Atbash cipher work?
Write the alphabet forwards, then write it again backwards underneath, so A lines up with Z and M lines up with N. Each letter in your message is swapped for the one beneath it. Numbers, spaces, and punctuation are left unchanged, which keeps the shape and length of the original message visible.
Are encoding and decoding the same in Atbash?
Yes. Atbash is its own inverse, meaning the very same operation both encrypts and decrypts. Running a message through Atbash twice returns the original text, so there is no separate decode mode and no key. That is why this tool uses a single result box for both directions.
Can you show an Atbash example?
The word HELLO becomes SVOOL, and converting SVOOL back gives HELLO again. The phrase ATTACK AT DAWN becomes ZGGZXP ZG WZDM. Because the mapping is fixed, repeated letters always map to the same substitute, so the double L in HELLO stays a double O.
What is the Atbash alphabet table?
It is the complete mapping shown as two rows: the plain alphabet A to Z over the cipher alphabet Z to A. To convert a letter you find it in the plain row and read the letter directly below it. The interactive table below the tool shows the full mapping at a glance.
Where does the Atbash cipher come from?
Atbash originated with the Hebrew alphabet, pairing the first letter Aleph with the last letter Taw, and the second letter Beth with the second-to-last Shin, which is how it got its name. It is at least two and a half thousand years old, making it one of the earliest known ciphers.
Is Atbash used in the Bible?
Several apparent examples appear in the Hebrew Bible. In the Book of Jeremiah the name Sheshach is widely read as an Atbash encoding of Babel, meaning Babylon, and Leb Kamai as an encoding of Kasdim, the Chaldeans. Scholars still debate whether these were deliberate ciphers or literary wordplay, but they show the technique was understood in antiquity.
How do you break or recognise an Atbash cipher?
Because there is only one possible mapping, you break Atbash simply by running the text through the cipher again. A clue that Atbash is in use is that A always becomes Z, so naturally rare letters like Z and Q start appearing as often as common letters, and very short words take on recognisable shapes.
Does Atbash change numbers, spaces, or punctuation?
No. Only the letters A to Z are mirrored, and each keeps its uppercase or lowercase form. Digits, spaces, line breaks, and punctuation pass through unchanged, so the layout of your message stays intact.
Is the Atbash cipher secure?
No. With a single fixed mapping and no key, Atbash offers no real protection and is solved instantly once recognised. It is best treated as an educational and puzzle cipher. For genuine security, modern algorithms such as AES should be used instead.
Is my text uploaded to a server?
No. All converting happens entirely in your browser, so your text is never uploaded, logged, or stored. Even a share link keeps your text in the part of the URL after the hash, which browsers never send to a server, so it stays private until you choose to share it.
How do I write an Atbash cipher in code?
Loop over each character and check whether it is a letter. If it is, subtract the code of A to get a number from 0 to 25, replace that number with 25 minus itself to mirror it, then add the code of A back and turn it into a character. Copy any non-letter through unchanged. In JavaScript charCodeAt and fromCharCode handle the conversions, which is exactly how this in-browser tool works.

Related tools

Keep going with these handy tools

Caesar Cipher

Vigenère Cipher

Rail Fence Cipher

Playfair Cipher

Affine Cipher

Baconian Cipher