Affine Cipher (Encode & Decode)

Security Tools

Encrypt letters with (a × x + b) mod 26

FreePrivateInstant
Add a file · .txt .md .csv .json … · up to 2.00 MB
Key a
Key b (0–25)
Embed this tool on your websiteFree
  1. Choose how tall the frame should be.
  2. Press Copy code.
  3. Paste it into your page, blog, WordPress or Notion HTML block.
Height

The tool runs inside your visitor's browser, nothing is uploaded, and a small "Powered by ToolCloak" line stays under it. The second line (script) is optional: it makes the frame fit the tool's height.

Similar tools you may like

History

All history →

Affine Cipher (Encode & Decode) — at a glance

Use two number keys to scramble text with the Affine cipher.

You paste
AFFINE CIPHER
Run
Result
IHHWVC SWFRCP

How to use it — step by step

Text, plus key a (must be coprime with 26) and key b (shift).

1

Add your text

Paste or type your input into the box. The Sample button fills in an example.

2

Choose the options

Pick the mode and settings you need. Results update when you run the tool again.

3

Press Run

The result is made instantly inside your browser.

4

Copy the result

Use the Copy button, or send it to another tool.

Pro tips

Small things that make the result better.

✦Valid values for a: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25.
✦With a = 1 it becomes the Caesar cipher.
✦Use the same keys to decode.

Quick facts

Freeno signup
Privateruns in your browser
Instantresult in a second
No limituse it as often as you like

Frequently Asked Questions

Why must a be coprime with 26?+

Otherwise two letters would map to the same one and the message could not be decoded.

What if I pick a wrong a?+

The tool tells you which values are allowed.

Is my data safe?+

Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.

Is this tool really free?+

Yes — completely free, no signup, no watermark and no usage limit.

More Free Tools