GCD Calculator

Find the Greatest Common Divisor using the Euclidean algorithm with steps.

Loading Smart Logic...

Quick Tip

Enter the two whole numbers you want to compare.

About This Tool

Why use GCD Calculator?

The greatest common divisor (GCD, also called HCF) is the largest whole number that divides both of your numbers exactly. This calculator finds it with the Euclidean algorithm and shows each division step, so you can follow the working rather than just copy an answer.

The method is simple: divide the larger number by the smaller, keep the remainder, and repeat until the remainder is zero. The last non-zero divisor is the GCD. For 48 and 18: 48 = 2 × 18 + 12, then 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0, so the GCD is 6. The tool also shows the LCM, because GCD × LCM always equals the product of the two numbers.

Key Benefits

Every step shown

Each division in the Euclidean algorithm is listed, which is what most homework questions ask you to write out.

GCD and LCM together

Because GCD × LCM = a × b, having both makes it easy to check your answer.

Coprime check

Numbers with a GCD of 1 are coprime, which matters for simplifying fractions and for modular arithmetic.

How to use GCD Calculator

  1. 1

    Enter the two whole numbers you want to compare.

  2. 2

    Read the GCD, and follow the Euclidean steps if you need to show your working.

  3. 3

    Check the coprime indicator: a GCD of 1 means the numbers share no common factor.

  4. 4

    Use the LCM shown alongside when you need the smallest number both values divide into.

Best use cases

Simplify a fraction by dividing the numerator and denominator by their GCD.

Split items into the largest possible equal groups.

Work out the largest square tile that fits a rectangular area exactly.

Check whether two numbers are coprime before using them in modular arithmetic.

GCD Calculator FAQs

Are GCD and HCF the same thing?

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

How does the Euclidean algorithm work?

Replace the larger number with the remainder of dividing it by the smaller one, and repeat. Because any common divisor of the two numbers also divides the remainder, the answer is preserved, and the numbers shrink quickly.

What is the GCD of two prime numbers?

Always 1, unless the two primes are identical. Distinct primes share no factors, so they are coprime.

How do I find the GCD of more than two numbers?

Work in pairs: take the GCD of the first two, then the GCD of that result with the third number, and so on.

Related Math Tools

More free math tools that work well alongside gcd calculator.