GCD Calculator

The greatest common divisor (GCD), called HCF in Indian schools, is the largest number that divides all the given numbers exactly. It is used to simplify fractions and ratios.

Two or more whole numbers, separated by commas or spaces.
Results update as you type.

GCD (HCF)

42

LCM of the same numbers
1,260

About this calculator

Enter two or more whole numbers.

How to use it

  1. Enter the numbers, separated by commas.
  2. Read the GCD and LCM.

The formula

GCD(a, b) = GCD(b, a mod b), until the remainder is 0
mod
remainder after division

Worked example

84, 126 and 210

  1. GCD(84, 126) = 42; GCD(42, 210) = 42.
  2. So the HCF is 42; the LCM is 1,260.

What the result means

For two numbers, GCD × LCM = the product of the numbers.

Assumptions

  • Whole numbers.

Limitations

  • Very large numbers above 10¹⁵ are not accepted.

Frequently asked questions

Is GCD the same as HCF?

Yes, and also GCF.

What is the HCF of 12 and 18?

6.

How is GCD used?

To simplify fractions and ratios.

Last reviewed on 3 October 2026. Found a mistake? Tell us.