🔐 Atbash Cipher
The Atbash cipher is a simple substitution cipher that reverses the alphabet (A↔Z, B↔Y, and so on). It's its own inverse — running the same text through it twice returns the original.
How the letters are flipped
Atbash maps the alphabet onto itself backwards: A becomes Z, B becomes Y, M and N swap in the middle. The tool works it out arithmetically rather than from a table, using the letter's position from the start of its own case:
base = uppercase ? 'A' : 'a'
new = base + (25 - (letter - base))
H is letter 7 -> 25 - 7 = 18 -> S
e is letter 4 -> 25 - 4 = 21 -> v
So the starting text "Hello, World!" comes back as "Svool, Dliow!" - the comma, the space and the exclamation mark ride through unchanged, and the capitals stay capital. Because the mapping is a mirror, applying it twice returns you to the start, so there is no key and no encode/decode switch to set.
What the tool leaves alone
- Only A-Z and a-z are touched. Digits, punctuation, spaces, line breaks and emoji come out exactly as they went in.
- Case is preserved position by position. An upper-case letter maps to an upper-case letter, so "Hi" gives "Sr" rather than "SR".
- Accented letters are not flipped. A precomposed e-acute is outside a-z and passes straight through.
Frequently asked questions
What is the Atbash cipher?
It is one of the oldest known substitution ciphers, originally applied to the Hebrew alphabet - aleph for tav, beth for shin, which is where the name comes from. It appears in the Book of Jeremiah, where Sheshach stands for Babel. Applied to the Latin alphabet it simply pairs A with Z, B with Y, and so on.
How do I decode an Atbash message?
Encode it again. Atbash is its own inverse, so running ciphertext through this page returns the plaintext. There is nothing to remember and nothing to set.
Is Atbash secure?
No, and it is not meant to be. It is a fixed substitution with no key at all, so anyone who suspects Atbash decodes it in seconds, and even someone who does not can break it by letter frequency. Treat it as a puzzle or a geocaching clue, never as protection.