Tested tool guide
Tested browser tools
Checked August 16, 2026
What LCM & GCD Calculator does, with a checked example
Enter two or more integers to calculate both their Greatest Common Divisor and Least Common Multiple. The accompanying prime factorizations show which factors contribute to each result: the GCD uses shared primes at their smallest exponents, while the LCM uses every represented prime at its largest exponent. A common mistake is to treat the LCM as the product of the inputs. That works for two positive integers only when their GCD is 1.
Worked example
A concrete input and expected output from the current implementation.
->
Expected output
GCD: 6; LCM: 36. Prime factorizations: 12 = 2^2 x 3; 18 = 2 x 3^2.
The shared primes use the smaller exponents, giving 2 x 3 = 6. Using the larger exponent of each prime gives 2^2 x 3^2 = 36.