The greatest common factor (GCF) of two or more numbers is the largest number that divides all of them exactly. It is also called the greatest common divisor (GCD) or highest common factor (HCF). You need it to simplify fractions, split things into equal groups and solve many number puzzles. Our GCF calculator finds the GCF of a whole list of numbers and gives their least common multiple too. This guide shows three ways to find it by hand.
How to use the calculator
Type the numbers separated by commas or spaces. With the default 12, 18, 24:
- GCF: 6
- LCM: 72
6 is the largest number that divides 12, 18 and 24 exactly, and 72 is the smallest number all three divide into.
Method 1: list the factors
Write out every factor of each number and pick the largest one they share.
- 12: 1, 2, 3, 4, 6, 12
- 18: 1, 2, 3, 6, 9, 18
- 24: 1, 2, 3, 4, 6, 8, 12, 24
The common factors are 1, 2, 3 and 6, so the GCF is 6. This is simple for small numbers but slow for big ones. The common factor calculator lists all shared factors if you want them.
Method 2: prime factorization
Break each number into primes and multiply the primes they have in common, using the smallest power of each.
- 12 = 2² × 3
- 18 = 2 × 3²
- 24 = 2³ × 3
Shared primes: 2 (lowest power 2¹) and 3 (lowest power 3¹). GCF = 2 × 3 = 6.
The prime factorization calculator does the first step for you.
Method 3: Euclid's algorithm
This 2,300-year-old method is the fastest, especially for large numbers. It uses the fact that the GCF of two numbers also divides their difference, and so their remainder.
Example: GCF of 252 and 198
| Step | Division | Remainder |
|---|---|---|
| 1 | 252 ÷ 198 = 1 | 54 |
| 2 | 198 ÷ 54 = 3 | 36 |
| 3 | 54 ÷ 36 = 1 | 18 |
| 4 | 36 ÷ 18 = 2 | 0 |
The last non-zero remainder is 18, so GCF(252, 198) = 18. For more than two numbers, find the GCF of the first two, then the GCF of that result and the next number, and so on. This is how the calculator works.
GCF and LCM together
For two numbers, there is a neat link:
For 12 and 18: GCF = 6 and LCM = 36, and 6 × 36 = 216 = 12 × 18. The LCM calculator covers least common multiples in more detail.
Practical uses
Simplifying fractions. Divide the top and bottom by the GCF. 18/24 has a GCF of 6, so it simplifies to 3/4 in one step. The fraction calculator always gives answers in simplest form.
Equal groups. You have 48 apples and 36 oranges and want identical gift bags with nothing left over. GCF(48, 36) = 12, so you can make 12 bags, each with 4 apples and 3 oranges.
Tiling a floor. A room 360 cm by 270 cm can be covered with square tiles with no cutting if the tile size divides both. The largest such tile is GCF(360, 270) = 90 cm. The tile calculator works out how many tiles you need.
Ratios. Simplifying 45 : 60 by the GCF of 15 gives 3 : 4. See the ratio calculator.
Special cases
- If one number divides the other, the smaller is the GCF: GCF(8, 32) = 8.
- If two numbers share no prime factors, the GCF is 1 and they are called coprime: GCF(8, 15) = 1.
- Two consecutive numbers are always coprime.
- GCF(n, 0) = n, since every number divides 0.
Frequently asked questions
Are GCF, GCD and HCF the same thing?
Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same idea.
Can I find the GCF of more than two numbers?
Yes. Enter as many as you like. The calculator applies Euclid's algorithm pairwise across the list.
What does a GCF of 1 mean?
The numbers are coprime: they share no factor other than 1. A fraction made from them is already in simplest form.
Which method is fastest by hand?
Euclid's algorithm, especially for large numbers. Listing factors is easiest for small numbers.
Try it yourself
Run your own numbers with our free tool: Greatest common factor (GCF) calculator. No sign-up, and it works on any device.