Dev TooloraLocal dev tools

> Encoders

Classic Ciphers

Encode or decode text with Vigenère, Atbash, Affine, Rail fence or ROT47 classic ciphers.

Runs locallyWorks offline
Back to results
Input

Source data

Mode
Output

Result

Your result will appear here.

Tool guide

About this tool.

  • Classic ciphers are hand-made substitution and transposition schemes from before computers. They are fun and useful for puzzles, teaching and obfuscation, but they offer no real security.
  • Everything runs locally in your browser or editor. Only the letters A-Z are changed by Vigenère, Atbash and Affine; digits, punctuation, spaces and accented letters pass through as they are.

  • Vigenère shifts each letter by the matching letter of a repeating key, so LEMON turns ATTACKATDAWN into LXFOPVEFRNHR. Atbash mirrors the alphabet (A becomes Z). Affine maps each letter x to a*x + b modulo 26, and a must be coprime with 26.
  • Rail fence writes the text in a zigzag over several rails and reads it rail by rail. ROT47 rotates the 94 printable ASCII characters by 47, so applying it twice returns the original.

Pick a cipher, set its options and paste your text.

Vigenère needs a key of letters. Affine needs the numbers a and b, where a must be coprime with 26. Rail fence needs a number of rails from 2 to 100.

Choose Encode or Decode for the ciphers that are not their own inverse.

The summary shows the direction and the cipher name.

  • Vigenère, key LEMON: ATTACKATDAWN → LXFOPVEFRNHR
  • Atbash: Hello → Svool
  • Affine a=5, b=8: AFFINE CIPHER → IHHWVC SWFRCP
  • Rail fence, 3 rails: WEAREDISCOVEREDFLEEATONCE → WECRLTEERDSOEEFEAOCAIVDEN
  • ROT47: Hello, World! → w6==@[ (@C=5P

  • Input is limited to 1,000,000 characters.
  • Classic ciphers are not secure encryption; never use them to protect real secrets.
  • Letters outside A-Z, such as accented letters, are left unchanged by the letter ciphers.
  • Vigenère advances the key only on letters, so spaces and punctuation do not consume it.

FAQ

Questions about Classic Ciphers

What can the Vigenère key contain?

The Vigenère key is 1 to 256 letters A-Z. Case does not matter. Digits and other characters are rejected and the message names the position of the first one.

Why is a=13 rejected for Affine?

Affine decoding needs a modular inverse of a, which exists only when a shares no factor with 26. Use one of 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23 or 25.

Why is there no Decode for Atbash and ROT47?

Atbash and ROT47 are their own inverse, so running them again restores the text. The Mode switch is hidden for these two ciphers.

Does rail fence handle emoji and accents?

Rail fence works on whole characters, so emoji and accented letters stay intact and decode back exactly. Use 2 to 100 rails.

Continue with

Caesar/ROT13 CipherRotate ASCII letters by a whole-number shift, preserving case and other characters; defaults to ROT13.Morse Code TranslatorConvert supported letters, digits and punctuation to dot/dash Morse notation and decode it to uppercase text.NATO Phonetic AlphabetSpell text with the NATO phonetic alphabet or turn code words back into text.