Affine Cipher (Encode & Decode)
Security ToolsEncrypt letters with (a × x + b) mod 26
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.
How to use it — step by step
Text, plus key a (must be coprime with 26) and key b (shift).
Add your text
Paste or type your input into the box. The Sample button fills in an example.
Choose the options
Pick the mode and settings you need. Results update when you run the tool again.
Press Run
The result is made instantly inside your browser.
Copy the result
Use the Copy button, or send it to another tool.
Pro tips
Small things that make the result better.
Quick facts
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.

