GCD and LCM Calculator (Prime Factorisation)
GCD and LCM of up to ten numbers by prime factorisation and Euclid's algorithm.
- Coprime
- No
Prime factorisation
| Number | Prime factors |
|---|---|
| 36 | 2² × 3² |
| 48 | 2⁴ × 3 |
| 60 | 2² × 3 × 5 |
Working
- 1.GCD = common primes with the lowest power: 2² × 3 = 12
- 2.LCM = every prime with the highest power: 2⁴ × 3² × 5 = 720
- 3.48 = 1 × 36 + 12
- 4.36 = 3 × 12 + 0
Formula and sources
GCD = product of the primes all numbers share, each with its lowest power LCM = product of every prime that appears, each with its highest power Euclid's algorithm: GCD(a, b) = GCD(b, a mod b), stopping when the remainder is 0
- Elementary number theory — primary and lower-secondary mathematics
When to use the GCD & LCM
GCD word problems
The GCD answers fair-sharing questions: 36 apples, 48 oranges and 60 snake fruits can be shared equally among at most 12 baskets.
LCM word problems
The LCM tells when repeating events coincide again: buses leaving every 12 and 18 minutes leave together again after 36 minutes.
A factor tree as a table
The factor table shows every number in power form, just like the result of a factor tree in a textbook.
More than two numbers
Enter up to ten numbers at once. Prime factorisation still works: shared primes with the lowest power for the GCD, every prime with the highest power for the LCM.
Frequently asked questions
What are coprime numbers?
Two numbers are coprime when their GCD is 1, such as 8 and 15. The LCM of coprime numbers equals their product.
When is Euclid's algorithm used?
For large numbers Euclid's algorithm is faster than factorising because it only uses division with remainder. The steps are shown for the first two numbers.
What is the difference between GCD and LCM?
The GCD is the largest number dividing all of them, while the LCM is the smallest number all of them divide. The GCD is never larger than the smallest number.
How do I find the GCD without factorising?
Use Euclid's algorithm: divide the larger number by the smaller, then replace the pair with the smaller number and the remainder. Repeat until the remainder is zero; the last divisor is the GCD.
How do GCD and LCM relate to fractions?
The GCD is used to simplify fractions, while the LCM is used as the common denominator when adding or subtracting them.
Related calculators
- Prime FactorisationPrime factors in power form, a prime check and the list of all divisors.Example: Prime factorisation2³ × 3² × 5Calculate →
- FractionsAdd, subtract, multiply and divide fractions or mixed numbers, with steps.Example: Simplest form31/12Calculate →
- PercentageX% of Y, percentage change, adding or removing a percent, and the value before a percent.Example: Increase15%Calculate →