How to use the GCF calculator
Type two or more whole numbers, separated by commas, spaces or semicolons. You can enter up to 20 numbers with up to 15 digits each. Leave out thousands separators: 12000, not 12,000.
Press Find GCF. You'll get the greatest common factor first, then the shared prime powers and the full list of common factors. The result also shows each number divided by the GCF, whether the numbers are coprime, and the Euclidean steps. With exactly two numbers you'll also see their LCM and Bezout coefficients.
- Enter at least two whole numbers, for example 12, 18, 30.
- Make sure no number contains a comma.
- Press Find GCF.
- Read the GCF, then the shared prime powers.
- Use the table to check that the GCF times each quotient gives back your number.
GCF example: 12, 18 and 30
In primes, 12 is 2^2 x 3, 18 is 2 x 3^2 and 30 is 2 x 3 x 5. Only 2 and 3 appear in all three. The lowest power of each is the first power, so the GCF is 2 x 3 = 6.
Every common factor of the three numbers is a factor of 6: 1, 2, 3 and 6. Dividing through gives 2, 3 and 5, which share nothing but 1. That's your proof that 6 is the greatest.
| Number | Prime factors | Divided by GCF | Check |
|---|---|---|---|
| 12 | 2^2 x 3 | 2 | 6 x 2 = 12 |
| 18 | 2 x 3^2 | 3 | 6 x 3 = 18 |
| 30 | 2 x 3 x 5 | 5 | 6 x 5 = 30 |
How to find GCF with the Euclidean algorithm
Factoring gets painful with large numbers. The Euclidean algorithm skips it. Divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and that remainder. When the remainder hits zero, the last divisor is the GCF.
For 84 and 30: 84 = 2 x 30 + 24, then 30 = 1 x 24 + 6, then 24 = 4 x 6 + 0. The GCF is 6. For three or more numbers, find the GCF of the first two and carry it into the next. Once the running GCF reaches 1, it can't go higher.
GCF(a, b) = GCF(b, a mod b)GCF(a, b, c) = GCF(GCF(a, b), c)GCF(0, a) = |a| when a is not zero
Greatest common factor of common pairs
Here are pairs that show up often in fraction and ratio problems. Each GCF was checked with the Euclidean algorithm.
| Numbers | GCF | Divided by GCF |
|---|---|---|
| 12 and 18 | 6 | 2 and 3 |
| 14 and 21 | 7 | 2 and 3 |
| 16 and 40 | 8 | 2 and 5 |
| 20 and 30 | 10 | 2 and 3 |
| 24 and 36 | 12 | 2 and 3 |
| 36 and 60 | 12 | 3 and 5 |
| 45 and 75 | 15 | 3 and 5 |
| 48 and 18 | 6 | 8 and 3 |
| 56 and 98 | 14 | 4 and 7 |
| 84 and 30 | 6 | 14 and 5 |
Using the GCF to simplify fractions and split into groups
To reduce a fraction to lowest terms, divide the top and bottom by their GCF. For 18/24 the GCF is 6, so the fraction becomes 3/4 in one step. Ratios work the same way: 12:18 becomes 2:3.
The GCF also answers "most equal groups" word problems. With 12 red, 18 blue and 30 green items, you can make 6 identical groups with nothing left over. Each group gets 2 red, 3 blue and 5 green. The GCF is the number of groups, and the quotients are what goes in each one.
GCD and HCF: same thing, different names
GCF (greatest common factor), GCD (greatest common divisor) and HCF (highest common factor) all mean the same number. US schools tend to say GCF, programmers and number theory books say GCD, and the UK and India often say HCF. This calculator works as a GCD or HCF calculator too.
A GCF of 1 means the numbers are relatively prime. With three or more numbers that doesn't mean every pair is coprime. 6, 10 and 15 have a GCF of 1, but 6 and 10 share 2, 6 and 15 share 3, and 10 and 15 share 5. The calculator reports both checks separately.
| Numbers | GCF | Relatively prime as a set | Every pair coprime |
|---|---|---|---|
| 8, 15, 49 | 1 | Yes | Yes |
| 6, 10, 15 | 1 | Yes | No |
| 12, 18, 30 | 6 | No | No |
Negative numbers and zero
The GCF is always reported as a positive number, so signs don't change it. GCF(-48, 18) is 6, the same as GCF(48, 18).
Every number divides zero, so GCF(0, 42) is 42. If every number you enter is zero, there's no greatest common factor at all, because every positive whole number divides zero. The calculator says so instead of making up an answer.
Sources
These references cover the definition, the prime factor method, the Euclidean algorithm and the Bezout identity used on this page.