✦ Spark of Why

Free tool · runs in your browser

GCD and modular inverse calculator with steps (extended Euclidean algorithm)

Enter two integers. You get gcd(a, b), numbers x and y with a·x + b·y = gcd, and a⁻¹ mod b when it exists — with every step of the algorithm.

Questions

When does a modular inverse exist?
Exactly when gcd(a, m) = 1. Then the x from a·x + m·y = 1 is the inverse modulo m.

Does it work for big numbers?
Yes — it uses exact big-integer arithmetic in your browser (useful for RSA exercises).

Is anything uploaded?
No.

All tools and explanations