Atbash Cipher

Security Client-side atbash cipher encryption decryption substitution alphabet

This tool runs entirely client-side, in your browser: your data is never sent anywhere.

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

  1. Each letter is converted to its position in the alphabet (A/a = 0, B/b = 1, ... Z/z = 25).
  2. The new position is computed as 25 - position (mirroring it around the middle of the alphabet).
  3. The new position is converted back to a letter, preserving the original case.
  4. Non-alphabetic characters (numbers, punctuation, spaces) are left unchanged.

Formula

For a letter at position p (0-25):

new_position = 25 - p

Example

InputOutput
HELLOSVOOL
Attack at dawnZggzxp zg wzdm
ZebraAmvyz

Notes