Loading calculator...
- The greatest common divisor (GCD) is the largest whole number that divides all of your numbers with no remainder.
- It is also called the greatest common factor (GCF) or highest common factor (HCF).
- Enter two to 20 numbers and you get the Euclidean algorithm steps, the common prime factors, the LCM and whether the numbers are coprime.
- Use it to simplify fractions and ratios in one step.
How to use the GCD calculator
Enter your numbers
Type two or more whole numbers, separated by commas, spaces or new lines.
Read the GCD
The greatest common divisor shows at the top as you type.
Follow the steps
The breakdown shows each division of the Euclidean algorithm, so you can copy the working into your homework.
Use the extras
Check the LCM of the same numbers and whether they are relatively prime (a GCD of 1).
Numbers must be whole and at least 1, with up to 12 digits each. If you have decimals, multiply them all by the same power of 10 first to turn them into whole numbers.
How to find the GCD
The Euclidean algorithm
Divide the larger number by the smaller one and note the remainder.
Replace the pair with the smaller number and the remainder, then divide again.
Repeat until the remainder is 0. The last non-zero remainder is the GCD.
For more than two numbers: GCD(a, b, c) = GCD(GCD(a, b), c).
The prime factor method
Write each number as a product of primes.
Keep only the primes that appear in every number, each with its lowest power.
Multiply them together. The product is the GCD.
If no prime is shared, the GCD is 1.
Worked examples
Euclidean algorithm for 48 and 36
Divide the larger number by the smaller, then repeat with the divisor and the remainder until the remainder is 0.
So GCD(48, 36) = 12. As a fraction, 48/36 simplifies to 4/3, because both numbers divide by 12.
Prime factors of 48, 36 and 60
Keep the primes all three numbers share, using the lowest power of each.
All three numbers divide by 12, and no larger number divides all three.
What the GCD is used for
Simplifying fractions
Divide the top and bottom of a fraction by their GCD to reduce it to lowest terms in one step.
Making equal groups
With 48 pencils and 36 erasers, the GCD, 12, is the most identical kits you can make with nothing left over.
Tiling and cutting
The largest square tile that fits a 48 by 36 inch floor exactly has sides of 12 inches.
Reducing ratios
Divide both sides of the ratio 48:36 by their GCD to get 4:3.
GCD and LCM: how they connect
For any two numbers, GCD × LCM = the two numbers multiplied together. The GCD is never larger than your smallest number, while the least common multiple is never smaller than your largest. Need the other one? Try the LCM calculator.
GCD calculator FAQ
What does GCD mean?
GCD stands for greatest common divisor: the biggest whole number that divides all of your numbers with no remainder. GCF and HCF mean exactly the same thing.
How do I find the GCD of two numbers?
Use the Euclidean algorithm: divide the larger by the smaller, then keep dividing the previous divisor by the remainder until the remainder is 0. The last non-zero remainder is the GCD. This calculator shows every step.
What if the GCD is 1?
The numbers are relatively prime, also called coprime. They share no factor other than 1, and a fraction made from them is already in lowest terms.
What is the GCD of a number and 0?
Mathematically it is the number itself, since every number divides 0. This calculator asks for numbers from 1 upward to keep the steps clear.
Can I find the GCD of more than two numbers?
Yes, up to 20. Find the GCD of the first two, then the GCD of that result and the next number, and so on.
How are the GCD and LCM related?
For two numbers, GCD times LCM equals the product of the two numbers. For 48 and 36, 12 × 144 = 1,728 = 48 × 36.