Encrypt with a times x plus b modulo 26; decryption with the inverse of a computed step by step.
Procedure
How it works
The affine cipher maps each letter $x$ (A = 0, …, Z = 25) to $E(x) = (a x + b) \bmod 26$. With $a = 1$ it is the Caesar cipher, with $a = b = 25$ it is Atbash.
Not every $a$ works. If $a$ shares a factor with 26 (it is even, or 13), two letters get the same image and the text cannot be decrypted: with $a = 2$, both A and N become $b$. So $a$ must be coprime to 26, which leaves 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23 and 25. Then $a$ has an inverse modulo 26, found with the extended Euclidean algorithm, and $D(y) = a^{-1} (y - b) \bmod 26$.
With $12 \cdot 26 = 312$ keys, trying all of them is instant. Two known letters are enough as well: they give two linear congruences in $a$ and $b$. Like every cipher that uses one fixed substitution alphabet, it also falls to letter frequencies.
Everything is calculated in your browser. Nothing you type leaves your device.