mode
GCD and LCM Calculator
Find the GCD and LCM of two integers using prime factorization with a Venn diagram.
More Math Calculators
Explore the category
Click to show tips
Pick a scenario to see how the calculator works, then adjust the values
Factor 360, a highly composite number with many divisors.
Key values: 360 = 2^3 x 3^2 x 5 · 24 divisors · phi(360) = 96
Check if 7919 is prime (it is -- the 1000th prime number).
Key values: 7919 is prime · 2 divisors · phi(7919) = 7918
Compute the GCD and LCM of 84 and 120.
Key values: 84 = 2^2 x 3 x 7 · 120 = 2^3 x 3 x 5 · GCD = 12, LCM = 840
Enter an integer greater than 1 to see its prime factorization, factor tree, and divisors.
Once you have the prime factorizations of two numbers, GCD and LCM follow directly:
Take each shared prime at the minimum exponent.
Take every prime (from either number) at the maximum exponent.
This identity means you only need to compute one (GCD or LCM) and derive the other. Euclid's algorithm computes GCD in time without needing factorization.
To simplify 48/180: factor and . . Divide both by 12: .
Two buses arrive every 12 and 18 minutes. When do they coincide? minutes.
Gears with 24 and 36 teeth: . Simplest ratio: 2:3.
The GCD (Greatest Common Divisor) is the largest number that divides both integers evenly. The LCM (Least Common Multiple) is the smallest positive number that both integers divide into evenly. For 12 and 18: GCD = 6, LCM = 36.
Factor both numbers into primes, then take each shared prime at its minimum exponent. For example, and . The shared primes are 2 and 3, so .
Factor both numbers into primes, then take every prime (from either number) at its maximum exponent. For and : .
For any two positive integers and , . This identity lets you compute one from the other. For example, and , and .
Two numbers are coprime (or relatively prime) when their GCD is 1, meaning they share no common prime factors. For example, 8 and 15 are coprime because and share no primes. A fraction is already in lowest terms when and are coprime.