Greatest Common Divisor / Highest Common Factor
Enter two or more positive integers to find their 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.
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)
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
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
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
Divide numerator and denominator by their GCD to get the simplest form.
48/36 = (48/12)/(36/12) = 4/3
GCD is used in RSA encryption and other cryptographic algorithms.
Finding common rhythmic patterns and time signatures.
Dividing items into equal groups, tiling problems, etc.