GCD and LCM Calculator
One set of integers per line, e.g. 12, 18, 24 - batch GCD and LCM with Euclidean steps
Output:
Formula:
Separator:
Calculation Result
Download CSV
| No. | Value | GCD | LCM | Euclidean steps |
|---|
Introduction to the tool and how to use it
Work out the greatest common divisor (GCD) and least common multiple (LCM) for as many sets of integers as you like, one set per line - handy for reducing fractions, finding common denominators and number theory practice.
How to use:
1. Enter one set of integers per line, separated by commas or spaces, e.g.
2. Choose the output (both, GCD only or LCM only) and optionally show the Euclidean steps;
3. Hit Run to get GCD, LCM and the algorithm steps - copy them or export as CSV.
The GCD is the largest common factor of the whole set and the LCM is the smallest common multiple; if a zero is present the LCM is reported as 0. All maths uses BigInt, so numbers longer than 20 digits stay exact.
How to use:
1. Enter one set of integers per line, separated by commas or spaces, e.g.
12, 18, 24;2. Choose the output (both, GCD only or LCM only) and optionally show the Euclidean steps;
3. Hit Run to get GCD, LCM and the algorithm steps - copy them or export as CSV.
The GCD is the largest common factor of the whole set and the LCM is the smallest common multiple; if a zero is present the LCM is reported as 0. All maths uses BigInt, so numbers longer than 20 digits stay exact.
GCD and LCM
GCD and LCM of 2520 and 3024
The GCD of 2520 and 3024 is 504 and the LCM is 15120.
- GCD504
- LCM15120
Euclidean algorithm steps
| Step | Equation |
|---|---|
| 1 | 3024 = 1 × 2520 + 504 |
| 2 | 2520 = 5 × 504 + 0 |
- Euclid's algorithm: divide the larger number by the smaller, then divide the smaller by the remainder and repeat until the remainder is 0. The last non-zero remainder is the GCD.
- LCM = the product of the two numbers divided by their GCD.
Common inputs
Message board
All messages →-
No one has spoken up yet — want to go first?