A little context. A clearer answer.
When this calculator is useful
The greatest common divisor (GCD), greatest common factor (GCF) and highest common factor (HCF) are different names for the same result: the largest positive integer that divides all the supplied numbers, when at least one is nonzero. This calculator also finds their least common multiple (LCM). Use the shared factor to reduce a fraction or the common multiple to find a shared denominator. Enter the integers together rather than running a separate calculator for each pair. For a related calculation, try Fraction Calculator with Mixed Numbers.
What to enter
| Input | What it means | Example value |
|---|---|---|
| Integers | Separate whole integers with spaces, line breaks or semicolons. Do not use decimal points or digit-grouping commas. | 84; 120; 36 |
How the calculation works
- Replace signs with absolute values and apply Euclid’s algorithm to obtain the GCD.
- For each pair use lcm(a,b) = |(a/gcd(a,b))b|, handling zero separately.
- Repeat through the list; the table shows the accumulated exact results.
gcd(a,b) = gcd(b, a mod b); lcm(a,b) = |(a/gcd(a,b))b|A worked example
Worked example: 84; 120; 36 gives GCD 12 and LCM 2520.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Accepts 2–20 integers of at most 80 digits each. Signs do not change the nonnegative GCD and LCM. Any zero makes the LCM zero; an all-zero list has GCD zero.
Frequently asked questions
Are GCD, GCF and HCF the same thing?
Yes. Greatest common divisor, greatest common factor and highest common factor all name the shared factor reported here. LCM is a different result: the least common multiple. For 12 and 18, the GCD is 6 and the LCM is 36.
Can I use negative numbers or zero?
Yes. Signs do not change the nonnegative results. A zero in the list makes the LCM zero; gcd(a, 0) is the absolute value of a. An all-zero list produces zero for both results.
Can I calculate the GCD and LCM of more than two numbers?
Enter 2–20 integers, each up to 80 digits. The calculator processes the list with exact integer arithmetic, and the table shows the accumulated results without dropping digits.