GCF calculator
Enter two or more whole numbers to get the greatest common factor and the least common multiple, with the factors laid out so you can see where they come from.
| Number | Prime factors | All factors |
|---|---|---|
| 24 | 2^3 × 3 | 1, 2, 3, 4, 6, 8, 12, 24 |
| 36 | 2^2 × 3^2 | 1, 2, 3, 4, 6, 9, 12, 18, 36 |
| 60 | 2^2 × 3 × 5 | 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 |
The GCF is the largest number in every "all factors" list: 12.
Finding the GCF without listing factors
Euclid's algorithm (about 300 BC, from his Elements) says: the GCF of two numbers is also the GCF of the smaller number and the remainder. Keep dividing until the remainder is 0 — the last divisor is the GCF.
| Divide | Result |
|---|---|
| 36 ÷ 24 | 1 remainder 12 |
| 24 ÷ 12 | 2 remainder 0 |
Remainder hit 0, so GCF(24, 36) = 12.
Two ways to find the GCF
List the factors. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24. Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36. The biggest one in both lists is 12.
Prime factors. 24 = 2³ × 3 and 36 = 2² × 3². Take the lowest power of each shared prime: 2² × 3 = 12. For the LCM, take the highest powers instead: 2³ × 3² = 72.
For big numbers, Euclid's algorithm (above) is fastest. Use the GCF to simplify fractions, and the LCM as a least common denominator.
Questions people ask
What is the greatest common factor (GCF)?
The largest whole number that divides every number in a set with no remainder. It is also called the greatest common divisor (GCD) or highest common factor (HCF). GCF(24, 36) = 12.
How is the GCF used with fractions?
Dividing a fraction’s numerator and denominator by their GCF puts it in lowest terms in one step: 24/36 ÷ 12/12 = 2/3.
What is the LCM?
The least common multiple is the smallest number every number in the set divides into. For denominators, it is the least common denominator.
How are GCF and LCM related?
For two numbers, GCF × LCM = the product of the numbers. 12 × 72 = 24 × 36 = 864.