Enter two or more whole numbers to find the largest number that divides all of them, with the steps shown.
The greatest common factor, also called the greatest common divisor (GCD) or highest common factor, is the largest whole number that divides every number in a set with no remainder. The GCF of 12 and 18 is 6, because 6 is the biggest number that goes into both. Enter two or more whole numbers above 0, separated by commas, spaces or semicolons, up to 50 numbers.
The page opens on 330, 75, 450, 225. The tool writes each as a product of primes and keeps the primes they all share, each to the lowest power it appears:
330 = 2 × 3 × 5 × 11
75 = 3 × 5 × 5
450 = 2 × 3 × 3 × 5 × 5
225 = 3 × 3 × 5 × 5
All four contain one 3 and one 5, and 75 has no 2 or 11, so the shared primes are 3 and 5. GCF(330, 75, 450, 225) = 3 × 5 = 15.
List the factors of each number and pick the biggest one they share. The factors of 12 are 1, 2, 3, 4, 6 and 12, and of 18 are 1, 2, 3, 6, 9 and 18. The shared ones are 1, 2, 3 and 6, so the GCF is 6. This is easy for small numbers and slow for large ones.
Write each number as a product of primes and multiply the shared primes. For 12, 18 and 24 the factorizations are 2 × 2 × 3, 2 × 3 × 3 and 2 × 2 × 2 × 3. Each has one 2 and one 3 in common, so the GCF is 2 × 3 = 6. If the numbers share no prime, the GCF is 1 and they are called coprime, like 8 and 15.
For large numbers it is much faster than factoring. Divide the larger number by the smaller, replace the larger with the remainder, and repeat until the remainder is 0. The last non-zero number is the GCF. For 1,071 and 462:
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| 1071 | 462 | 2 | 147 |
| 462 | 147 | 3 | 21 |
| 147 | 21 | 7 | 0 |
The remainder reaches 0 after three divisions, and the last divisor is 21, so GCF(1,071, 462) = 21. The calculator uses this method for numbers of any size, so the GCF is always exact. For example GCF(123,456,789, 987,654,321) = 9. The prime factorization steps are shown only for numbers up to about 10 trillion.
| Numbers | GCF | After dividing by the GCF |
|---|---|---|
| 12 and 18 | 6 | 2 and 3 |
| 48 and 36 | 12 | 4 and 3 |
| 8 and 15 | 1 | 8 and 15 |
| 100 and 75 | 25 | 4 and 3 |
| 252 and 105 | 21 | 12 and 5 |
| 1071 and 462 | 21 | 51 and 22 |
The last column shows the numbers left after dividing out the GCF. They are always coprime, which is why dividing by the GCF puts a fraction in lowest terms.
The least common multiple is the other half of the pair. For two numbers, GCF × LCM = the product of the numbers. For 12 and 18 the GCF is 6 and the LCM is 36, and 6 × 36 = 216 = 12 × 18. That relation holds only for two numbers at a time. Use the LCM Calculator for the multiple.
The large line shows the GCF written as GCF(numbers) and the answer. Below it, when the numbers are small enough, are the prime factorizations and the line that multiplies the shared primes. A note says whether the numbers are coprime or divide evenly by the GCF.
List the factors of each number and choose the biggest one they share, or multiply the shared prime factors from their prime factorizations. For large numbers, use the Euclidean algorithm.
It is 1, because two different primes share no factor other than 1.
It is 6. The factors of 12 are 1, 2, 3, 4, 6 and 12, those of 18 are 1, 2, 3, 6, 9 and 18, and the largest one in both lists is 6.
Nothing. They are three names for the same number: the greatest common factor, greatest common divisor and highest common factor.
Divide the numerator and the denominator by their GCF. The GCF of 84 and 126 is 42, so 84/126 becomes 2/3.
From 2 to 50 whole numbers above 0, separated by commas, spaces or semicolons.
Sources: Wikipedia: Greatest common divisor; Wikipedia: Euclidean algorithm; Wikipedia: Coprime integers
Pick another tool to jump straight to it.