HomeMath › GCF Calculator

GCF Calculator

Enter two or more whole numbers and get their greatest common factor shown both ways teachers ask for it: by prime factorization (lowest shared powers) and by Euclid’s algorithm with every division line written out.

Greatest common factor
Factorization view
Euclid’s algorithm
LCM of the same numbers

Two roads to the same answer

Prime factorization is the visual method: write every number as a product of primes and collect the lowest power of each prime that all of them share. Euclid’s algorithm is the fast method: repeatedly replace the pair (a, b) with (b, a mod b) until the remainder hits zero — the last divisor is the GCF. Both appear in the results so you can copy whichever your assignment requires, and for lists longer than two the GCF is folded through the list pair by pair.

How it’s calculated

Euclid: GCF(a, b) = GCF(b, a mod b) until the remainder is 0. Lists: GCF(a, b, c) = GCF(GCF(a, b), c). Factor view: GCF = product over shared primes of p^(minimum exponent). Bonus row: LCM = product of highest powers, computed with exact big-integer arithmetic.

Accepts up to 20 positive whole numbers, each up to 10¹².

Worked example

GCF of 48, 180, 240. Euclid on the first pair: 180 = 3×48 + 36; 48 = 1×36 + 12; 36 = 3×12 + 0, so GCF(48, 180) = 12; then GCF(12, 240) = 12 since 240 = 20×12 exactly, giving 12. Factor view: 48 = 2⁴×3, 180 = 2²×3²×5, 240 = 2⁴×3×5 share 2²×3 = 12. The LCM of the same list is 720.

Common mistakes

  • Taking the highest shared power of primes instead of the lowest — that builds the LCM, not the GCF.
  • Stopping Euclid one step early: the answer is the last divisor, not the last remainder (which is 0).
  • Missing a shared prime because one factorization was incomplete.
  • Assuming the GCF must be one of the input numbers — it usually is not.

Where it is used

  • Reducing fractions and simplifying ratios to lowest terms.
  • Splitting different quantities into the largest possible identical groups.
  • Cutting stock (boards, fabric, pipe) into the longest equal pieces with no waste.
  • Number theory and cryptography — Euclid’s algorithm underpins modular inverses.

Frequently asked questions

What is the greatest common factor?

The GCF (also called GCD or highest common factor) is the largest whole number that divides every number in your list without remainder. For 48, 180, and 240 it is 12.

How does Euclid’s algorithm find the GCF?

Divide the larger number by the smaller and keep the remainder; then divide the previous divisor by that remainder, repeating until the remainder is 0. The last nonzero remainder is the GCF: 180 = 3×48 + 36, 48 = 1×36 + 12, 36 = 3×12 + 0, so GCF(48,180) = 12. It is dramatically faster than factoring for big numbers.

How do I get the GCF from prime factorizations?

Factor each number and multiply the lowest power of every prime they all share. 48 = 2⁴×3, 180 = 2²×3²×5, 240 = 2⁴×3×5 — every number carries at least 2² and 3¹, so the GCF is 4×3 = 12.

What does a GCF of 1 mean?

The numbers are coprime (relatively prime) — they share no factor beyond 1, like 8 and 15. Fractions with coprime numerator and denominator are already in lowest terms.

Where do I actually use the GCF?

Reducing fractions (divide top and bottom by their GCF), splitting things into the largest equal groups (48 pencils and 180 erasers into 12 identical kits), simplifying ratios, and cutting material into the longest equal lengths without waste.