Back to Tools

Tool GCD / HCF Calculator

Enter two or more positive integers (comma-separated or one per line). The calculator instantly finds the Greatest Common Divisor — also known as the Highest Common Factor — and shows the full working steps.

Separate multiple values with commas, spaces, or new lines. Press Ctrl + Enter to calculate.

Enter your numbers and press Calculate GCD to see the result here.

Guide What is GCD (HCF)?

The Greatest Common Divisor (GCD) — also called the Highest Common Factor (HCF) — is the largest positive integer that divides each number in a given set evenly, without leaving a remainder.

For example, the GCD of 12 and 18 is 6, because:

Key point: GCD is always ≤ the smallest number in the set, and always ≥ 1. When the GCD is 1, the numbers are called coprime.

Methods 3 Ways to Find the GCD

You can calculate the GCD using any of these methods. Our calculator uses the Euclidean algorithm internally for speed, but shows the prime factorization steps too.

1. Prime Factorization Method

Break each number into prime factors, take the lowest power of each common prime, and multiply.

Example: GCD(12, 18)
12 = 2² × 3
18 = 2 × 3²
Common primes with lowest powers: 2¹ × 3¹ = 6

2. Euclidean Algorithm (Fastest)

Repeatedly divide the larger number by the smaller, then replace with the remainder, until you reach zero.

Example: GCD(12, 18)
18 = 12 × 1 + 6
12 = 6 × 2 + 0 → remainder 0, so GCD = 6

3. Listing All Factors

List all factors of each number and pick the largest one they share. Best for small numbers.

Example: GCD(12, 18)
Factors of 12: 1, 2, 3, 4, 6, 12
Factors of 18: 1, 2, 3, 6, 9, 18
Common: 1, 2, 3, 6 → Largest = 6

Reference Common GCD Values at a Glance

Click any pair to load it into the calculator instantly.

GCD(12, 18)6
GCD(24, 36)12
GCD(8, 12)4
GCD(15, 25)5
GCD(10, 15)5
GCD(9, 12)3
GCD(20, 30)10
GCD(7, 11)1
GCD(16, 24)8
GCD(45, 60)15
GCD(100, 75)25
GCD(48, 72)24

FAQ Frequently Asked Questions

What is the GCD of 12 and 18?

The GCD of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 evenly.

Is GCD the same as HCF?

Yes. GCD (Greatest Common Divisor) and HCF (Highest Common Factor) refer to the exact same concept — the largest common factor of a set of numbers. The naming differs by region and textbook.

What is the relationship between GCD and LCM?

For any two positive integers a and b: GCD(a, b) × LCM(a, b) = a × b. So if you know one, you can always find the other.

What is the GCD of coprime numbers?

The GCD of coprime numbers is always 1. For example, GCD(7, 11) = 1 because 7 and 11 share no common factors other than 1.

What is the GCD of two consecutive numbers?

The GCD of any two consecutive numbers (like 5 and 6, or 100 and 101) is always 1, because they share no common factor greater than 1.

Can the GCD be greater than the smallest number?

No. The GCD of a set of numbers is always ≤ the smallest number in the set. And it is always ≥ 1.

What is the fastest way to find the GCD?

The Euclidean algorithm is the fastest method — especially for large numbers. It repeatedly divides the larger number by the smaller and replaces with the remainder, until the remainder is 0. The last non-zero remainder is the GCD.