GCD Calculator (Greatest Common Divisor)
Calculate the greatest common divisor (GCD) or highest common factor (HCF) of numbers.
Mathematical Formula
Overview & Explanation
The Greatest Common Divisor (GCD), also known as Highest Common Factor (HCF), is the largest positive integer that divides both numbers without a remainder.
How It Works
- Apply the Euclidean algorithm iteratively: GCD(a, b) = GCD(b, a mod b) until remainder is zero.
Practical Applications
- Simplifying ratios and fractions.
- Tiling rectangular areas without cutting tiles.
Greatest common divisor
The greatest common divisor (GCD), also called the highest common factor (HCF), is the largest whole number that divides two or more numbers exactly. The divisors of 84 include 1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84, and those of 36 include 1, 2, 3, 4, 6, 9, 12, 18, 36, so GCD(84, 36) = 12.
The Euclidean algorithm
Listing divisors is slow for large numbers. Euclid's algorithm repeatedly replaces the larger number by the remainder after dividing: 84 = 2 × 36 + 12, then 36 = 3 × 12 + 0. When the remainder reaches 0, the last non-zero remainder, 12, is the GCD. This method has been used for over two thousand years and is still how computers calculate it.
Prime factorisation also works: 84 = 2² × 3 × 7 and 36 = 2² × 3², and the shared primes at their lowest powers give 2² × 3 = 12.
Uses
The GCD simplifies fractions: 36/84 divided top and bottom by 12 becomes 3/7. It solves sharing problems, such as cutting 84 cm and 36 cm ribbons into equal pieces as long as possible (12 cm each), and it is linked to the LCM through GCD × LCM = a × b, so LCM(84, 36) = 3,024 ÷ 12 = 252.
Worked Example: GCD of 48 and 180
Find GCD.
Euclidean Algorithm
180 mod 48 = 36, 48 mod 36 = 12, 36 mod 12 = 0
Frequently Asked Questions
Is HCF the same as GCD?
What does a GCD of 1 mean?
Is HCF the same as GCD?
Related Calculators
LCM Calculator (Least Common Multiple)
Find the least common multiple (LCM) of two or more numbers.
Percentage Calculator
Calculate percentages, percentage change, and percentage of a number instantly.
Percentage Increase Calculator
Calculate the percentage growth or increase from an initial value to a final value.
Percentage Difference Calculator
Calculate the relative percentage difference between two numbers when neither is a baseline.