MathsFree

GCD Calculator

Use this free online GCD calculator to find the Greatest Common Divisor of two or more numbers using the Euclidean algorithm. Also known as HCF (Highest Common Factor).

Enter Values

Result

Enter values above and click Calculate to see your result.

AI Assistant

Ask about this calculator

I can help you understand the gcd calculator formula, interpret your results, and answer follow-up questions.

Try asking

Formula

GCD via Euclidean Algorithm: GCD(a, b) = GCD(b, a mod b)

Repeatedly divide the larger number by the smaller and take the remainder until the remainder is 0. The last non-zero remainder is the GCD.

Worked Example

Find GCD of 48 and 18 Step 1: 48 mod 18 = 12 Step 2: 18 mod 12 = 6 Step 3: 12 mod 6 = 0 Result: GCD = 6

What Is the Greatest Common Divisor (GCD)?

The Greatest Common Divisor (also called the Highest Common Factor or HCF) is the largest positive integer that divides two numbers without leaving a remainder. The Euclidean algorithm, one of the oldest known algorithms, provides an efficient way to find it.
  • GCD(12, 18) = 6 because 6 is the largest number that divides both 12 and 18 evenly
  • The Euclidean algorithm finds GCD by repeatedly dividing and taking remainders until reaching 0
  • GCD is essential for simplifying fractions: 12/18 simplifies to 2/3 by dividing both by GCD(12,18) = 6
  • Two numbers with a GCD of 1 are called coprime or relatively prime (e.g., 8 and 15)

GCD is used in fraction simplification, ratio reduction, cryptography (RSA algorithm), and determining whether two gear sizes mesh properly in engineering.

You can also calculate changes using our LCM Calculator, Ratio Calculator or Fraction Calculator.

Frequently Asked Questions

What is the GCD?

The Greatest Common Divisor is the largest positive integer that divides both numbers without a remainder. For example, GCD(24, 36) = 12 because 12 is the biggest number that goes evenly into both.

Is GCD the same as HCF?

Yes. GCD (Greatest Common Divisor) and HCF (Highest Common Factor) are the same thing. Different countries and textbooks use different terms.

What is the Euclidean algorithm?

An efficient method for computing GCD by repeatedly applying division with remainder. It works by replacing the larger number with the remainder of dividing the two numbers, until one of them becomes 0.

What does it mean if GCD is 1?

If GCD(a, b) = 1, the numbers are called coprime or relatively prime. They share no common factors other than 1. For example, 8 and 15 are coprime.

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

Find the GCD of the first two numbers, then find the GCD of that result with the third number. For example, GCD(12, 18, 24): GCD(12,18) = 6, then GCD(6, 24) = 6.

Accurate and Reliable

All calculations run locally. Step-by-step solutions you can trust.

Precise Mathematical Calculations Powered by Calculory AI