About this calculator
Enter two or more whole numbers.
How to use it
- Enter the numbers, separated by commas.
- Read the GCD and LCM.
The formula
- mod
- remainder after division
Worked example
84, 126 and 210
- GCD(84, 126) = 42; GCD(42, 210) = 42.
- So the HCF is 42; the LCM is 1,260.
What the result means
For two numbers, GCD × LCM = the product of the numbers.
Euclid’s division algorithm, step by step
This is the method the calculator uses. Divide the larger number by the smaller, then divide the divisor by the remainder, and repeat until the remainder is 0. The last non-zero remainder is the HCF. For 867 and 255:
- 867 = 255 × 3 + 102
- 255 = 102 × 2 + 51
- 102 = 51 × 2 + 0
- The remainder is now 0, so HCF(867, 255) = 51.
Prime factorisation method
Write each number as a product of primes, then multiply the lowest power of every prime that appears in all of them. Using the page example:
- 84 = 2² × 3 × 7
- 126 = 2 × 3² × 7
- 210 = 2 × 3 × 5 × 7
- Common primes at their lowest powers: 2 × 3 × 7 = 42, the HCF.
- Every prime at its highest power gives the LCM: 2² × 3² × 5 × 7 = 1,260.
HCF and LCM of common pairs
HCF × LCM = product of the numbers holds for two numbers only: 36 × 48 = 1,728 = 12 × 144. For 4, 6 and 8 the HCF is 2 and the LCM is 24, giving 48, but the product is 192.
| Numbers | HCF | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 16, 24 | 8 | 48 |
| 18, 27 | 9 | 54 |
| 24, 36 | 12 | 72 |
| 36, 48 | 12 | 144 |
| 15, 25 | 5 | 75 |
| 30, 45 | 15 | 90 |
| 48, 72 | 24 | 144 |
| 56, 84 | 28 | 168 |
| 60, 90 | 30 | 180 |
| 8, 15 | 1 | 120 |
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.
What is the HCF of 36 and 48?
12. Their LCM is 144.
What is the HCF of two consecutive numbers?
Always 1. Any number dividing both would also divide their difference, which is 1, so HCF(14, 15) = 1.
Last reviewed on 12 October 2026. How we calculate and check. Found a mistake? Tell us.

