GCD and LCM calculator

Find the greatest common divisor and least common multiple of two integers.

Calculation inputs

Greatest common divisor

6
Least common multiple
72
QR code

How the calculation works

Euclid’s algorithm finds the GCD of the absolute values. For two nonzero inputs, the LCM is the absolute product divided by the GCD. This calculator uses zero for the GCD of two zeros and the LCM of any pair containing zero.

Example

For 18 and 24, the GCD is 6 and the LCM is 72.

Methodology and definitions

Method checked