Loading
Euclid's algorithm finds gcd(a, b) by repeated division; run backwards it writes the gcd as ax + by, which gives modular inverses — the key step of RSA encryption.
Find by Euclid’s algorithm.
| a | b | q | r |
|---|---|---|---|
| 252 | 198 | 1 | 54 |
| 198 | 54 | 3 | 36 |
| 54 | 36 | 1 | 18 |
| 36 | 18 | 2 | 0 |
The calculator below opens on this example.
Taking the last quotient.
Not shifting the numbers.
Negative remainders.
Not checking.
Whole numbers only; very large powers are handled exactly.
Add this calculator to a new note, next to your own working. It stays live: change the numbers there any time.