Whole numbers (2 to 10)
Whole numbers greater than 0, up to 30 digits each.
GCF (greatest common factor)
LCM (least common multiple)
Step by step
Enter at least two whole numbers to get the GCF and the LCM.
Use this GCF calculator to find the greatest common factor of two or more whole numbers. The GCF is the biggest number that divides all of them exactly, and you also need it to simplify a fraction. Enter up to 10 numbers and the GCF is shown first, with the way it was found. The least common multiple is calculated alongside it.
How to find the GCF
There are three common methods. The calculator shows the last two for you.
Method 1: list the factors
Write every number that divides each value. The factors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24 and 48. The factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18 and 36. The common ones are 1, 2, 3, 4, 6 and 12, so the GCF of 48 and 36 is 12. This is fine for small numbers and slow for big ones.
Method 2: prime factorization
Split each number into primes, then multiply the primes they share, each with the smallest exponent. 84 = 2² × 3 × 7 and 126 = 2 × 3² × 7. The shared primes are 2, 3 and 7, each at power 1 at most, so the GCF is 2 × 3 × 7 = 42.
Method 3: the Euclidean algorithm
Divide the bigger number by the smaller one, keep the remainder, and repeat with the divisor and the remainder until the remainder is 0. For 252 and 105: 252 = 2 × 105 + 42, then 105 = 2 × 42 + 21, then 42 = 2 × 21 + 0. The last divisor is 21, so the GCF is 21. This is the fastest method for large numbers.
GCF of three or more numbers
Find the GCF of the first two, then the GCF of that answer and the next number, and so on. For 100, 75 and 50 the prime factorizations are 2² × 5², 3 × 5² and 2 × 5². Only 5 is shared by all three, with the smallest exponent 2, so the GCF is 5² = 25.
Simplify a fraction with the GCF
Divide the numerator and the denominator by their GCF. 48/36 has a GCF of 12, so it simplifies to 4/3. 84/126 has a GCF of 42, so it simplifies to 2/3. Enter the numerator and the denominator as your two numbers and the calculator shows the simplified fraction.
When the GCF is useful
- Equal groups: with 84 red marbles and 126 blue marbles, the greatest number of identical groups with nothing left over is the GCF, 42 groups. Each group has 2 red and 3 blue marbles.
- Fractions and ratios: reduce a ratio such as 48 : 36 to its simplest form, 4 : 3.
- Factoring in algebra: the GCF of the coefficients is the number you take out in front of the brackets.
Need the least common multiple instead? Use the LCM calculator, or see both answers on the GCF and LCM calculator. You may also like the rule of three calculator.
GCF FAQ
What does GCF stand for?
Greatest common factor: the largest whole number that divides every number in your list with no remainder. It is also called the greatest common divisor (GCD) or the highest common factor (HCF).
What is the GCF of two prime numbers?
It is 1 when the two primes are different, because a prime has no factor other than 1 and itself. If you enter the same prime twice, the GCF is that prime.
What is the GCF of consecutive numbers?
It is always 1. Any number that divides both n and n + 1 must also divide their difference, which is 1. For example, the GCF of 14 and 15 is 1.
What if one number divides the other?
Then the GCF is the smaller number. Since 36 = 3 × 12, the GCF of 12 and 36 is 12.
What does a GCF of 1 mean?
The numbers are coprime: they share no prime factor. A fraction made of two coprime numbers, such as 8/15, is already in its simplest form.
How many numbers can I enter?
Between 2 and 10 whole numbers greater than 0, up to 30 digits each. The calculation is exact, with no rounding.