Free Online Tool

Affine Cipher

Apply mathematical transformations for encryption using the Affine cipher algorithm.

How to Use Affine Cipher

  1. Enter plaintext and leave the tool in Encode mode.
  2. The current component applies the fixed defaults a = 5 and b = 8 to every letter.
  3. Switch to Decode and swap the ciphertext back into the input to apply the modular inverse.
  4. Copy the case-preserving result; spaces and punctuation remain unchanged.

For each letter index x, encryption computes (5x + 8) mod 26. Since 5 is coprime to 26, its modular inverse makes decryption possible.

Examples

Encode with a = 5, b = 8 — input:

AFFINE CIPHER

Output:

IHHWVC SWFRCP

Case-preserving encode — input:

Hello

Output:

Rclla

Features

Privacy Focused

All processing happens in your browser. No data is sent to servers.

Free Forever

No registration, no limits, completely free to use.