Atbash & Affine Cipher Decoder
Decode Atbash and affine substitution ciphers with your choice of parameters.
Output appears here as you type — decoded on your device.
Input is processed on your device. Nothing you paste is sent anywhere.
What is the Atbash & Affine Cipher Decoder?
Atbash maps each letter to its mirror image in the alphabet (A↔Z, B↔Y), while an affine cipher applies the formula (a × position + b) mod 26, generalising both Atbash and Caesar into one arithmetic substitution.
Atbash is one of the oldest ciphers known, originally applied to the Hebrew alphabet and appearing in biblical texts. It has no key at all: the alphabet is simply reversed, so the transformation is fixed and self-inverse — apply it twice and you are back where you started.
The affine cipher generalises the family. Each letter's position is multiplied by a and offset by b, modulo 26. The multiplier a must be coprime with 26 (1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25) or the mapping isn't reversible — two letters would collide. Set a = 1 and you have a Caesar cipher; set a = 25, b = 25 and you have Atbash.
With 12 valid multipliers and 26 offsets there are only 312 affine keys, so this cipher is brute-forceable in a fraction of a second and survives only in puzzles.
Atbash & Affine Cipher Decoder at a glance
- Atbash
- A↔Z, B↔Y — keyless and self-inverse
- Affine formula
- E(x) = (a·x + b) mod 26
- Valid a values
- Must be coprime with 26 — 12 choices
- Total affine keys
- 312 — trivially brute-forced
How to use the Atbash & Affine Cipher Decoder
- 1Choose Atbash for the reversed alphabet, or Affine to set your own a and b.
- 2For affine, enter a (coprime with 26) and b, then paste the ciphertext.
- 3Read the plaintext and adjust the parameters if it doesn't resolve.
When you would reach for it
- Solving an Atbash-encoded clue in a puzzle hunt or CTF.
- Exploring how modular arithmetic underlies classical substitution ciphers.
- Testing a handful of affine keys against a short ciphertext.
Atbash & Affine Cipher Decoder — frequently asked questions
Last reviewed · questions or corrections: contact@decoder.tools