GCD and LCM Calculator with Euclidean Algorithm Steps
Computes GCD and LCM of a list of integers and prints every division step of the Euclidean algorithm.
Use the tool
Why this tool exists
The Euclidean algorithm replaces the larger number by the remainder until the remainder is zero. Seeing each line, such as 1071 = 2 x 462 + 147, helps in class and when you need to show your work.
With more than two numbers the tool folds from left to right: it takes the GCD of the first two, then that result with the third, and so on, and builds the LCM the same way using lcm(a, b) = a / gcd(a, b) x b. Big integers are exact. Signs are ignored and zero is rejected to avoid trivial cases.
How to use it
- Enter two or more integers separated by spaces, commas or new lines.
- Read the GCD and LCM at the top.
- Follow the division steps below to see how the GCD was found.
- Copy the result if you need it for a worksheet.
Frequently asked questions
How many numbers can I enter?
Up to 30 integers of up to 60 digits each.
What if the GCD is 1?
The numbers are coprime and their LCM is their product.
Does it show prime factors?
Not here. Use the prime factorization tool for that.
Does it accept negative numbers?
Yes, but the sign is ignored.