Tools

GCD & LCM Calculator

Greatest common divisor and least common multiple of two or more numbers, entered space or comma separated . Both answers are shown against the prime factorisation they come from, with the Euclidean division steps for a pair.

Try
GCD — greatest common divisor
12
Largest number dividing all 2 inputs
LCM — least common multiple
720
Smallest number all 2 inputs divide into
Numbers
2
Shared primes
2
Present in every input
Common divisors
6
Divisors of the GCD
Reduced ratio
4 : 15
Each input over the GCD
Prime factorisationExponent of each prime, per input
235Factorisation
4841·2^4 × 3
1802212^2 × 3^2 × 5
GCD — min21·12
LCM — max421720

Take the smallest exponent in each column and you have the GCD; take the largest and you have the LCM. A column holding a dot contributes nothing to the GCD, because that prime is missing from at least one input.

Euclidean algorithm4 divisions to reach remainder 0
Stepaba ÷ ba mod b
148180048
218048336
34836112
4361230

Each step replaces (a, b) with (b, a mod b). The divisor of the row that finally hits remainder 0 — 12 — is the GCD.

Check
48 × 180 = 8,640
GCD × LCM = 12 × 720 = 8,640 — the two always agree for a pair
Common divisorsEvery number that divides all the inputs
1234612
Share

marduc812

© 202620260824_1c411cc