GCD Calculator

Greatest Common Divisor / Highest Common Factor

Enter two or more positive integers to find their GCD.


Add this Calculator to Your Site

What is GCD?

The Greatest Common Divisor (GCD), also known as Greatest Common Factor (GCF) or Highest Common Factor (HCF), is the largest positive integer that divides each of the given numbers without leaving a remainder.

Methods to Find GCD

1. Euclidean Algorithm

The most efficient method. Based on the principle that GCD(a, b) = GCD(b, a mod b).

GCD(48, 36):
48 = 36 * 1 + 12
36 = 12 * 3 + 0
GCD = 12 (last non-zero remainder)

2. Prime Factorization

Find the prime factors of each number and multiply the common factors.

48 = 2^4 * 3
36 = 2^2 * 3^2
Common: 2^2 * 3 = 4 * 3 = 12
GCD = 12

3. Listing Factors

List all factors of each number and find the largest common one.

Factors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48
Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36
Common: 1, 2, 3, 4, 6, 12
GCD = 12

Properties of GCD

  • Commutative: GCD(a, b) = GCD(b, a)
  • Associative: GCD(a, GCD(b, c)) = GCD(GCD(a, b), c)
  • Identity: GCD(a, 0) = a
  • Coprime: If GCD(a, b) = 1, then a and b are coprime
  • Relationship with LCM: GCD(a, b) * LCM(a, b) = a * b

GCD for Multiple Numbers

To find GCD of more than two numbers:

GCD(a, b, c) = GCD(GCD(a, b), c)

Example: GCD(48, 36, 24) = GCD(GCD(48, 36), 24) = GCD(12, 24) = 12

Applications of GCD

Simplifying Fractions

Divide numerator and denominator by their GCD to get the simplest form.

48/36 = (48/12)/(36/12) = 4/3

Cryptography

GCD is used in RSA encryption and other cryptographic algorithms.

Music Theory

Finding common rhythmic patterns and time signatures.

Problem Solving

Dividing items into equal groups, tiling problems, etc.

Other Calculators