GCF Calculator

GCF Calculator

Enter two or more whole numbers to get their greatest common factor — also called the greatest common divisor (GCD) or highest common factor (HCF) — with the prime factors they share and the Euclidean algorithm written out step by step. The least common multiple is shown alongside.

Two to 20 whole numbers separated by commas or spaces, each up to 1,000,000,000,000.
GCF12
LCM720
Prime factorization of 482⁴ × 3
Prime factorization of 362² × 3²
Prime factorization of 602² × 3 × 5
Common prime factors2² × 3
Euclidean algorithm for 48 and 3648 = 1 × 36 + 12 → 36 = 3 × 12 + 0 → GCF 12
Each number ÷ GCF4, 3, 5

Euclid's algorithm: divide, keep the remainder, repeat until the remainder is 0 — the last nonzero remainder is the GCF. Then continue with the remaining numbers: GCF(12, 60) = 12. GCF = 12.

Calculated on your device · formulas checked against known results · How we test

How to use the GCF calculator

Type two or more whole numbers separated by commas or spaces. You get the greatest common factor, the prime factorization of every number, the primes they all share, Euclid's algorithm written out for the first pair, and each number divided by the GCF — the reduced numbers you would use after simplifying. The LCM of the same set appears in the first row.

GCF, GCD and HCF: one idea, three names

The greatest common factor of a set of whole numbers is the largest number that divides every one of them with no remainder. US textbooks say GCF, computer science and number theory say greatest common divisor (GCD), and British and Indian schools say highest common factor (HCF). They are the same number. The factors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24, 48; the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, 36; the largest number on both lists is 12.

Euclid's algorithm step by step

Listing factors gets slow fast. Euclid's method, over 2,000 years old, needs only division: divide the larger number by the smaller, replace the larger with the remainder, and repeat until the remainder is 0. The last nonzero remainder is the GCF.

  1. 1071 = 2 × 462 + 147
  2. 462 = 3 × 147 + 21
  3. 147 = 7 × 21 + 0 → GCF(1071, 462) = 21

It works because any number that divides both a and b also divides a − q × b, the remainder, so each step keeps the same set of common divisors while shrinking the numbers. For three or more numbers, find the GCF of the first two, then the GCF of that result and the next number: GCF(48, 36) = 12, then GCF(12, 60) = 12.

Prime factorization method

Factor each number into primes and keep only the primes that appear in every number, each at its lowest power: 48 = 2⁴ × 3, 36 = 2² × 3², 60 = 2² × 3 × 5. All three contain 2 (lowest power 2²) and 3 (lowest power 3¹); 5 appears only in 60, so it is dropped. GCF = 2² × 3 = 12. The LCM calculator uses the same factorizations the other way around, keeping every prime at its highest power.

Simplifying fractions and ratios

Dividing the numerator and denominator by their GCF puts a fraction in lowest terms in one step: 36/48 → GCF 12 → 3/4. The same move simplifies a ratio (36 : 48 = 3 : 4) — see the ratio calculator — and the fraction calculator applies it automatically after every operation.

Worked examples

Equal kits: you have 48 pencils and 36 erasers and want identical kits with nothing left over. The largest possible number of kits is GCF(48, 36) = 12, each holding 48 ÷ 12 = 4 pencils and 36 ÷ 12 = 3 erasers.

Largest square tile: a 60 in × 36 in floor should be covered with whole square tiles and no cuts. The biggest tile is GCF(60, 36) = 12 inches, and the floor takes 5 × 3 = 15 of them.

GCF and LCM together: for two numbers, a × b = GCF × LCM. 48 × 36 = 1,728 and 12 × 144 = 1,728, which confirms both results at once. The rule is for pairs only; it fails for three numbers (48 × 36 × 60 ≠ 12 × 720).

Frequently asked questions

What is the GCF of 12 and 18?

6. The factors of 12 are 1, 2, 3, 4, 6, 12 and the factors of 18 are 1, 2, 3, 6, 9, 18; the largest shared factor is 6. By primes: 12 = 2² × 3, 18 = 2 × 3², common part 2 × 3 = 6.

What does it mean if the GCF is 1?

The numbers are coprime (relatively prime): they share no factor other than 1. That happens for two different primes like 17 and 5, but also for composite pairs like 8 and 9. A fraction whose numerator and denominator are coprime is already in lowest terms.

Is the GCF the same as the GCD and the HCF?

Yes. Greatest common factor, greatest common divisor and highest common factor are different names for the same number, used in different countries and subjects.

Can the GCF be larger than one of the numbers?

No. The GCF can never exceed the smallest number in the set, and it equals that number exactly when the smallest number divides all the others — GCF(12, 36, 60) = 12.

How do I find the GCF of three or more numbers?

Take two numbers at a time: GCF(a, b, c) = GCF(GCF(a, b), c). Or factor each number into primes and multiply the primes that appear in every factorization at their lowest powers.

Embed this calculator on your website

Free for any website or blog. Paste this code where you want the calculator to appear:

All free calculator widgets

Last updated: October 9, 2026

Menu

Categories

Finance Calculators22 calculatorsBusiness & Shopping Calculators6 calculatorsHealth & Fitness Calculators9 calculatorsMath & School Calculators19 calculatorsDate & Time Calculators10 calculatorsHoliday Countdowns16 calculatorsEveryday Tools15 calculators

CalcWorthy

AboutContactPrivacy PolicyTerms of Use

Language

Language
EnglishEnglishالعربيةArabicবাংলাBanglaDeutschGermanEspañolSpanishفارسیPersianFrançaisFrenchעבריתHebrewहिन्दीHindiBahasa IndonesiaIndonesianItalianoItalian日本語Japanese한국어KoreanBahasa MelayuMalayNederlandsDutchPolskiPolishPortuguêsPortugueseРусскийRussianไทยThaiTürkçeTurkishУкраїнськаUkrainianاردوUrduTiếng ViệtVietnamese简体中文Simplified Chinese