What it does
The Atbash cipher is one of the oldest known substitution ciphers, originally used for the Hebrew alphabet. It works by reversing the alphabet: the first letter is swapped with the last, the second with the second-to-last, and so on.
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
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
So A becomes Z, B becomes Y, C becomes X, and so on down to Z becoming A.
A key property of Atbash is that it is its own inverse: applying the exact same transformation twice returns the original text. That means there's no separate "encode" and "decode" — running the cipher once encodes it, and running it again on the result decodes it.
Try it
How it works
- Each letter is converted to its position in the alphabet (
A/a= 0,B/b= 1, ...Z/z= 25). - The new position is computed as
25 - position(mirroring it around the middle of the alphabet). - The new position is converted back to a letter, preserving the original case.
- Non-alphabetic characters (numbers, punctuation, spaces) are left unchanged.
Formula
For a letter at position p (0-25):
new_position = 25 - p
Example
| Input | Output |
|---|---|
HELLO | SVOOL |
Attack at dawn | Zggzxp zg wzdm |
Zebra | Amvyz |
Notes
- Atbash provides no real security by modern standards — it has only 26 possible letter mappings, and since it's a fixed 1-to-1 substitution with no key, it can be reversed instantly (indeed, without even knowing it's Atbash, simple frequency analysis breaks it in seconds).
- It's included here mainly for historical interest, puzzles, and CTF (Capture The Flag) challenges, where Atbash is a common easy-difficulty encoding.
- Because Atbash is self-inverse, the same button and function handle both encoding and decoding — just run it again on the result to get the original text back.