GCF Calculator (Greatest Common Factor)

Enter two or more whole numbers to get their greatest common factor, least common multiple, prime factorizations and the Euclidean algorithm worked out.

Separate with commas or spaces. Whole numbers only.

Result

Greatest common factor12
Least common multiple5,040
All common factors1, 2, 3, 4, 6, 12

Prime factorization

  • 48 = 2^4 × 3
  • 180 = 2^2 × 3^2 × 5
  • 84 = 2^2 × 3 × 7

Three ways to find the greatest common factor

1. List the factors

Write every factor of each number and pick the biggest one they share. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24. Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36. The largest common factor is 12. This is fine for small numbers but slow for large ones.

2. Prime factorization

Split each number into primes, then multiply the primes that appear in every number, each raised to its lowest power. For 48 = 2⁴ × 3 and 180 = 2² × 3² × 5, the shared part is 2² × 3 = 12.

3. The Euclidean algorithm

Divide the larger number by the smaller, keep the remainder, and repeat with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCF. For 1071 and 462: 1071 = 462 × 2 + 147, 462 = 147 × 3 + 21, 147 = 21 × 7 + 0, so the GCF is 21. This method, over 2,000 years old, is what the calculator uses because it stays fast even for 12-digit numbers.

More than two numbers

GCF(a, b, c) = GCF(GCF(a, b), c). Find the GCF of the first pair, then combine it with the next number, and so on.

Why the GCF matters

  • Simplifying fractions: divide top and bottom by their GCF. 42/56 becomes 3/4 because the GCF is 14.
  • Simplifying ratios: the ratio calculator uses the same idea to reduce 12:18 to 2:3.
  • Factoring algebra: 6x² + 9x = 3x(2x + 3) pulls out the GCF of the coefficients.
  • Equal groups: with 48 pencils and 36 erasers, the largest number of identical kits you can make is GCF(48, 36) = 12.

Least common multiple

The LCM is the smallest number every input divides into. It is what you need to add fractions with different denominators. The calculator shows it alongside the GCF.

Frequently asked questions

What is the greatest common factor?

The GCF of two or more whole numbers is the largest number that divides all of them with no remainder. The GCF of 12 and 18 is 6.

Is GCF the same as GCD and HCF?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.

How do you find the GCF using prime factorization?

Break each number into primes and multiply the primes they share, using the smallest power of each. 360 = 2³×3²×5 and 84 = 2²×3×7 share 2²×3, so the GCF is 12.

What is the GCF of two prime numbers?

1, unless they are the same prime. Numbers whose GCF is 1 are called coprime or relatively prime.

How are GCF and LCM related?

For two numbers, GCF × LCM = the product of the numbers. Since 12 × 18 = 216 and the GCF is 6, the LCM is 216 ÷ 6 = 36.

Sources and official references

Last reviewed October 10, 2026. Results are estimates for planning; see our disclaimer.

GCF guides

A student writing formulas on a chalkboardGCF vs. LCM: What's the Difference and When to Use EachThe greatest common factor and least common multiple are easy to confuse. Learn what each one means, how they're related, and which one a word problem needs.3 min readA man standing in front of a chalkboard covered in equationsThe Euclidean Algorithm: The Fastest Way to Find the GCFHow Euclid's division method finds the greatest common factor of large numbers in a few steps, why it works, and how to extend it to three or more numbers.3 min readA young boy writing complex formulas on a chalkboardPrime Factorization: Factor Trees, Division Ladders and Divisibility RulesBreak any number into prime factors using factor trees or the ladder method, with divisibility shortcuts and examples of using primes to find the GCF and LCM.3 min readA person writing with a pencilSimplifying Fractions with the GCF (Including Mixed Numbers and Algebra)Reduce any fraction to lowest terms in one step using the greatest common factor, with examples for improper fractions, mixed numbers and algebraic fractions.2 min readTwo toddlers playing with colorful letter blocksGCF Word Problems: 8 Worked Examples with Clear ExplanationsPractice greatest common factor word problems about groups, gift bags, tiles, ribbons and teams, with a simple checklist for spotting when to use the GCF.3 min readA man with glasses thinking in front of a chalkboardFactoring Out the GCF in Algebra: Step-by-Step with ExamplesHow to find the greatest common factor of algebraic terms, factor it out of polynomials, handle negatives and binomial factors, and check your work.3 min read