⚡ 2026 Edition · Free Forever

GCD Calculator — Greatest Common Divisor with steps

Find the Greatest Common Divisor (GCD) — also known as the GCF or HCF — of two or more whole numbers. See the full Euclidean-algorithm working, a prime-factor Venn diagram, and an AI explanation of the logic.

Step-by-step Visual diagram AI insights Private & free

GCD / GCF Calculator

Live · BigInt-safe
Tip: enter two or more whole numbers. Press Enter to calculate.
Quick answer

What is the Greatest Common Divisor?

The Greatest Common Divisor (GCD) of two or more integers is the largest whole number that divides all of them exactly. For example, the GCD of 48 and 36 is 12. It is identical to the Greatest Common Factor (GCF) and Highest Common Factor (HCF) — if you prefer a tool built around that name, the dedicated GCF calculator shows the same answer with factor-pair working. The fastest method is the Euclidean algorithm: gcd(a, b) = gcd(b, a mod b).

Why this tool

A complete GCD tool, not just a number

Built for homework, fraction simplification and engineering — with transparent working you can learn from.

Euclidean algorithm steps

Watch gcd(a,b) reduce to gcd(b, a mod b) line by line until the remainder hits zero.

Prime-factor confirmation

Cross-checks the answer by multiplying the shared prime powers — perfect for exams.

GCF = HCF = GCD

One tool covers every name your textbook uses, plus the related LCM for context.

How it works

Find the GCD in three steps

1

Enter your numbers

Type two or more whole numbers, e.g. 48, 36.

2

We run the algorithm

The Euclidean algorithm and prime factors compute the answer instantly.

3

Read the worked solution

Get the GCD, the related LCM, a Venn diagram and a plain-English AI explanation.

Worked examples

Common GCD results

Tap any row to load it into the calculator.

NumbersGCDQuick reasoning
12, 186shared factor 2×3
48, 3612shared 2²×3
24, 60, 3612shared 2²×3
17, 191both prime → coprime
100, 8020shared 2²×5
81, 27, 99shared 3²
8, 124shared 2²
24, 3612shared 2² × 3
6, 82shared 2
4, 62shared 2
6, 93shared 3
8, 102shared 2

How to find the GCD (Greatest Common Divisor)

There are three reliable ways to find the GCD, and this calculator uses all of them so you can pick the method your class prefers.

1. The Euclidean algorithm (fastest)

Replace the larger number with the remainder of dividing it by the smaller, and repeat until the remainder is 0. The last non-zero value is the GCD. For example: gcd(48, 36) → gcd(36, 12) → gcd(12, 0) = 12.

2. Prime factorization

Break each number into primes and multiply the lowest power of every shared prime. For 48 = 2⁴×3 and 36 = 2²×3², the shared primes give 2²×3 = 12.

3. Listing factors

Write out every factor of each number and pick the largest common one. This is intuitive for small numbers but slow for large ones.

GCD and LCM are linked by the identity GCD(a, b) × LCM(a, b) = a × b, so once you know one, the other is easy.

Where the GCD is used

  • Simplifying fractions — divide numerator and denominator by their GCD.
  • Splitting into equal groups — the GCD is the largest equal group size.
  • Gear ratios and engineering — reducing ratios to lowest terms.
  • Cryptography — the Euclidean algorithm underpins modular inverses in RSA.
FAQ

Frequently asked questions

Is GCD the same as GCF and HCF?

Yes. The Greatest Common Divisor (GCD), Greatest Common Factor (GCF) and Highest Common Factor (HCF) are three names for exactly the same thing — the largest whole number that divides all the inputs.

How do you find the GCD of two numbers?

The fastest way is the Euclidean algorithm: replace the larger number with the remainder when it is divided by the smaller, and repeat until the remainder is 0. The last non-zero number is the GCD.

What is the GCD of two coprime numbers?

If two numbers share no common factors (they are coprime), their GCD is 1. For example, gcd(17, 19) = 1.

Can this find the GCD of three or more numbers?

Yes. Enter any list such as 24, 60, 36 — the calculator folds the GCD across the whole set, because gcd(a, b, c) = gcd(gcd(a, b), c).

How are GCD and LCM related?

They satisfy GCD(a, b) × LCM(a, b) = a × b. The calculator shows both so you can see the relationship.