Greatest Common Factor

GCF / GCD and LCM of any list of integers — exact (BigInt), with a prime-factor breakdown, the Euclidean algorithm shown step by step, and Bézout coefficients.

Calculator Numbers & Math Updated Jun 21, 2026
How to Use
  1. Type two or more whole numbers separated by spaces or commas — e.g. <code>12 18 24</code>.
  2. The <strong>GCF (= GCD)</strong> and <strong>LCM</strong> update instantly and exactly, even for very large integers (computed with BigInt).
  3. The <em>prime-factorization</em> table shows why: the GCF takes the lowest power of each shared prime, the LCM the highest power of every prime (numbers up to 10<sup>12</sup> are factorized).
  4. For two numbers you also get the Bézout identity — integers x, y with <code>ax + by = gcd</code> (from the extended Euclidean algorithm).
  5. Open <strong>Show Work</strong> below for the full Euclidean division chain. Negative signs are ignored; GCF/LCM use absolute values.
GCF / GCD greatest common factor
LCM least common multiple

Show Work

Enter values to see the step-by-step calculation.

Methods & formulas

Euclidean algorithm
gcd(a, b) = gcd(b, a mod b), repeat until remainder 0
GCF ↔ LCM
lcm(a, b) = |a · b| / gcd(a, b)
Prime-factor view
GCF = ∏ p^min(e) · · · LCM = ∏ p^max(e)
List fold
gcd(a, b, c) = gcd(gcd(a, b), c)
Bézout identity
a·x + b·y = gcd(a, b) — from extended Euclid
Coprime
gcd = 1 ⇔ no shared factor

About the Greatest Common Factor

Working on everyday maths and number work? The Greatest Common Factor is a free browser tool that gives you the answer in seconds. GCF / GCD and LCM of any list of integers — exact (BigInt), with a prime-factor breakdown, the Euclidean algorithm shown step by step, and Bézout coefficients.

How it works

Put each value in its box and read the answer as you go. Because it recalculates live, you can play with the inputs to see how each one moves the result — handy for checking your own working or planning ahead. Everything happens on your device, so it is fast and private.

Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.

Frequently Asked Questions

What's the difference between GCF, GCD and HCF?

They're three names for the same thing. <strong>GCF</strong> (greatest common factor), <strong>GCD</strong> (greatest common divisor) and <strong>HCF</strong> (highest common factor) all mean the largest positive integer that divides every number in the set with no remainder.

How is the GCF actually computed?

By the <strong>Euclidean algorithm</strong>: gcd(a, b) = gcd(b, a mod b), repeated until the remainder is 0. It's far faster than factoring — gcd(1071, 462) takes just a few steps. For a list, the tool folds it pairwise: gcd(a, b, c) = gcd(gcd(a, b), c). The prime-factorization view is shown alongside as a teaching aid, but the answer itself comes from Euclid, which is why it stays exact and instant even for huge numbers.

How do you get the LCM from the GCF?

lcm(a, b) = |a × b| ÷ gcd(a, b). Dividing by the GCD first (the tool computes <code>a ÷ gcd × b</code>) keeps the intermediate value small and avoids overflow. In prime-factor terms, the LCM is the product of the <em>highest</em> power of every prime that appears, while the GCF is the product of the <em>lowest</em> power of the primes shared by all.

What does "coprime" mean?

Two or more numbers are <strong>coprime</strong> (relatively prime) when their GCF is 1 — they share no common factor other than 1. For example 8 and 15 are coprime even though neither is prime. The tool flags this for you.

What are the Bézout coefficients?

For two numbers a and b, Bézout's identity guarantees integers x and y such that <code>ax + by = gcd(a, b)</code>. The extended Euclidean algorithm finds them. They're the backbone of modular inverses and RSA-style key math — e.g. the inverse of a mod m exists exactly when gcd(a, m) = 1, and Bézout's x is that inverse.

Does it handle very large numbers?

Yes — all arithmetic uses JavaScript BigInt, so GCF and LCM are exact for integers of any length (hundreds of digits). Only the optional prime-factorization table is capped (at 10<sup>12</sup>) because factoring large numbers is genuinely slow; the GCF/LCM themselves are never approximated.

How do I use the Greatest Common Factor?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Do I need to install or sign up for anything?

Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.

Is my information private?

Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.

Common Use Cases

Simplifying fractions

Divide numerator and denominator by their GCF to reduce a fraction to lowest terms — e.g. 18/24 ÷ 6 = 3/4.

Scheduling & cycles

Use the LCM to find when repeating events line up again — two buses every 12 and 18 minutes coincide every 36 minutes.

Tiling and packing

The GCF gives the largest square tile that fills a rectangle with no cuts; the LCM gives the smallest square a tile pattern repeats into.

Gear ratios & engineering

Reduce ratios to simplest form and find common rotation periods using GCF and LCM.

Modular arithmetic & crypto study

Bézout coefficients give modular inverses; coprimality is the condition for an inverse to exist.

Teaching number theory

Show students both the prime-factorization method and the Euclidean algorithm side by side for the same numbers.

Last updated: