GCF Calculator
Enter two or more whole numbers to find their greatest common factor, every factor they share and each number's own factors, with the working shown.
How to use the GCF Calculator
- Type or paste Whole numbers (Two or more positive whole numbers).
- Read your answer in the results panel. It updates as you type, and the breakdown, step-by-step working and any charts or tables appear below it.
- Use Share link to save or send the exact calculation, or Copy to paste the results elsewhere.
What the GCF is
The greatest common factor (also called greatest common divisor, GCD, or highest common factor, HCF) is the largest whole number that divides every number in a set with no remainder. For 24 and 36 the common factors are 1, 2, 3, 4, 6 and 12, so the GCF is 12.
Method 1: Euclid’s algorithm
Euclid’s method, over 2,000 years old, is still the fastest way to find a GCF by hand or by computer. It relies on one fact: the GCF of two numbers also divides their difference, and therefore the remainder when one is divided by the other.
- Divide the larger number by the smaller and note the remainder.
- Replace the larger number with the smaller, and the smaller with the remainder.
- Repeat until the remainder is 0. The last non-zero remainder is the GCF.
Example with 1071 and 462:
- 1071 = 2 × 462 + 147
- 462 = 3 × 147 + 21
- 147 = 7 × 21 + 0
The GCF is 21. Even huge numbers need only a few dozen steps.
Method 2: prime factorization
Factor each number into primes and keep only the primes that appear in all of them, each with its lowest power. For 24, 36 and 60:
- 24 = 2³ × 3
- 36 = 2² × 3²
- 60 = 2² × 3 × 5
Common primes with lowest powers: 2² and 3. GCF = 4 × 3 = 12. The prime 5 is left out because it does not divide 24 or 36.
Listing all common factors
A common factor divides every number in the set. There is a neat shortcut for finding them all: the common factors of a set are exactly the factors of its GCF, because anything dividing all the inputs must also divide their GCF. For 36, 48 and 60 the GCF is 12 = 2² × 3, so the common factors are 1, 2, 3, 4, 6 and 12. The prime exponents give the count: (2 + 1)(1 + 1) = 6.
You can confirm it by comparing lists, which the factor table under the result does for you:
- Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
- Factors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48
- In both: 1, 2, 3, 4, 6, 12
Uses of the GCF
- Simplifying fractions: 24/36 divided top and bottom by 12 becomes 2/3.
- Simplifying ratios: 24 : 36 : 60 reduces to 2 : 3 : 5. The calculator shows this reduced ratio.
- Tiling: square tiles of side 1, 2, 3, 4, 6 or 12 units fit exactly into a 36 × 48 rectangle.
- Equal grouping: with 24 red and 36 blue beads, the largest number of identical bags you can make with nothing left over is 12.
Tips
- If the GCF is 1, the numbers are called relatively prime or coprime. They need not be prime themselves: 8 and 15 are coprime.
- The GCF of a set never exceeds its smallest number.
- 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.
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 number.
What is the GCF of two prime numbers?
1, unless they are the same prime. Distinct primes share no factor other than 1.
How do I use the GCF to simplify a fraction?
Divide the numerator and denominator by their GCF. For 18/24 the GCF is 6, giving 3/4.
What is the fastest way to find the GCF of large numbers?
Euclid’s algorithm. It repeatedly replaces the pair with the smaller number and the remainder, and finishes in very few steps even for large numbers.
How do I find common factors of two numbers?
List the factors of each number and keep those that appear in both, or find the GCF and list its factors, which gives the same result faster.
What is the difference between common factors and the GCF?
Common factors are all the numbers that divide every input. The GCF is the largest of them, and every other common factor divides the GCF.