Home › Math & Science › GCD Calculator

GCD Calculator

Find the largest number that divides your numbers exactly with this free GCD calculator — the GCD is also called the HCF, or highest common factor. Enter two to six numbers and see the answer worked out by the Euclidean algorithm, the fast method mathematicians have trusted for over two thousand years, with the LCM of the same numbers shown as a bonus.

Enter at least two positive whole numbers, each up to 1,00,00,000 (one crore). Leave the extra boxes empty if you do not need them.

GCD of 48 and 36 is 12
LCM is 144 · Check: 48 × 36 = 1,728 = 12 × 144
Euclidean algorithm:
  1. 48 = 36 × 1 + 12
  2. 36 = 12 × 3 + 0
  3. The remainder is 0, so the last divisor, 12, is the GCD

How to use

  1. Type your first two numbers in Number 1 and Number 2 — the boxes start with 48 and 36.
  2. Add up to four more numbers in the optional boxes if you need the GCD of a bigger set.
  3. Press Find GCD — the answer also updates as you type.
  4. Read the GCD in big type, check the bonus LCM underneath, and follow the Euclidean algorithm steps to see how the answer was reached.

Common GCD pairs

NumbersGCDNumbersGCD
12 and 18648 and 3612
24 and 361256 and 9814
15 and 25581 and 2727
17 and 231100 and 7525
12, 18 and 306120 and 18060

A GCD of 1 — like 17 and 23 — means the numbers are coprime: they share no factor except 1 itself.

How it works

The greatest common divisor of two numbers is the biggest number that divides both of them exactly. The divisors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24 and 48; the divisors of 36 are 1, 2, 3, 4, 6, 9, 12, 18 and 36. The shared ones are 1, 2, 3, 4, 6 and 12, and the greatest of them is 12. Listing divisors works, but it is slow for large numbers, so this calculator uses the Euclidean algorithm instead.

Euclid’s method is beautifully simple. Divide the bigger number by the smaller and keep only the remainder. Then repeat — divide the smaller number by that remainder — until a division comes out exact. The divisor in that final, exact step is the GCD. Watch it on 48 and 36: 48 = 36 × 1 + 12, then 36 = 12 × 3 + 0. Remainder 0 means stop; the GCD is 12. It works because any common divisor of the two numbers must also divide their remainder, so the GCD survives unchanged at every step while the numbers shrink fast.

Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until the remainder is 0  |  For more numbers: GCD(a, b, c) = GCD(GCD(a, b), c)  |  Link with LCM: GCD × LCM = a × b (for two numbers)

For three or more numbers the same idea is chained: find the GCD of the first pair, then the GCD of that answer with the next number, and so on — the steps box shows the full chain for the first pair and a summary line for each number after that. The bonus LCM under the result comes from the famous link between the two: for any pair, GCD × LCM equals the pair multiplied together, so LCM = (48 × 36) ÷ 12 = 144.

The GCD’s day job is simplifying fractions and ratios: 48/36 shrinks to 4/3 by dividing top and bottom by the GCD, 12. It also decides how big identical groups can be — 48 boys and 36 girls can be split into teams of 12 with nobody left out, and 12 is the largest team size that works. In India the same number is taught as the HCF (highest common factor) in school, usually next door to the LCM.

Worked example

Find the GCD of 48 and 36 — the pair this calculator opens with.

Step 1: Divide 48 by 36: 48 = 36 × 1 + 12. Keep the remainder, 12.
Step 2: Divide 36 by 12: 36 = 12 × 3 + 0.
Step 3: The remainder is 0, so stop. The last divisor is the answer.

GCD of 48 and 36 = 12. The check under the result confirms the family link: 48 × 36 = 1,728, and GCD × LCM = 12 × 144 = 1,728. Add a third number — 30 — and the GCD of the set becomes 6.

FAQ

What is the GCD of 48 and 36?

The GCD of 48 and 36 is 12. By the Euclidean algorithm: 48 = 36 × 1 + 12, then 36 = 12 × 3 + 0, so the last divisor, 12, is the GCD. The divisors they share are 1, 2, 3, 4, 6 and 12, and 12 is the greatest.

Is GCD the same as HCF?

Yes. GCD (greatest common divisor), HCF (highest common factor) and GCF (greatest common factor) are three names for the same number — the largest whole number that divides each of your numbers exactly. Indian school books usually say HCF; most other countries say GCD.

How does the Euclidean algorithm work?

Divide the larger number by the smaller and note the remainder. Then divide the smaller number by that remainder, and keep going. When a division leaves remainder 0, the divisor in that step is the GCD. For 48 and 36 it takes just two steps: remainders 12, then 0, so the GCD is 12.

What does a GCD of 1 mean?

It means the numbers are coprime (or relatively prime): they share no common divisor except 1. For example, 17 and 23 are both prime, so their GCD is 1. Coprime numbers matter in fractions — a fraction whose top and bottom have GCD 1 is already in its simplest form.

How do I find the GCD of three or more numbers?

Chain the pairs: GCD of the first two, then the GCD of that result with the third number, and so on. For 12, 18 and 30: GCD(12, 18) is 6, and GCD(6, 30) is 6, so the GCD of the set is 6. This calculator accepts up to six numbers and shows the chain.

Why do I need the GCD for fractions?

To simplify a fraction, divide the top and bottom by their GCD — the biggest number that divides both. 48/36 divided top and bottom by 12 becomes 4/3, fully simplified in one step. Without the GCD you would have to simplify in stages (by 2, then 2, then 3).