All 312 affine keys tried and ranked by English fitness, with the E and T shortcut and the decryption table.
Procedure
How it works
The affine cipher enciphers a letter $x$ (A = 0, …, Z = 25) as $y = (a x + b) \bmod 26$. To decrypt, $x = a^{-1} (y - b) \bmod 26$, which needs $\gcd(a, 26) = 1$: that leaves 12 values for $a$ and 26 for $b$, so only 312 keys, few enough to try all of them and rank the results by quadgram fitness.
There is also a shortcut that shows why the affine cipher falls to two guesses. If the two most frequent ciphertext letters stand for E and T, then $y_1 \equiv 4a + b$ and $y_2 \equiv 19a + b \pmod{26}$; subtracting gives $15 a \equiv y_2 - y_1$, solved with $15^{-1} \equiv 7 \pmod{26}$. Two known plaintext letters are always enough when their difference is invertible.
The Caesar cipher is the case $a = 1$, and Atbash (A and Z swapped, B and Y, and so on) is $a = b = 25$.
Everything is calculated in your browser. Nothing you type leaves your device.