LCM Calculator and Highest Common Factor (GCF) Calculator
LCM and GCF
LCM(a,b) = a ÷ GCF(a,b) × b
Values separated by commas or spaces
Read the list of nonnegative whole numbers.
LCM(a,b) = a ÷ GCF(a,b) × b
This arithmetic explanation folds pairwise rules across the entire list; any zero makes LCM zero, and long diagram labels are abbreviated while full results appear below.
Worked example you can change
GCF is the greatest common divisor; LCM(a,b) = a ÷ GCF(a,b) × b for nonzero a and b.
- Input integers: 12, 18
- GCF / HCF = 6; LCM = 36
Calculator
Enter 2–100 nonnegative whole numbers, up to 100 digits each and 32,768 characters total; an all-zero list is undefined.
- Least common multiple (LCM)
- 36
- Greatest common factor (GCF / HCF)
- 6
Formula variants
| Shape or method | Formula | Meaning |
|---|---|---|
| Greatest common factor | GCF(a,b) = GCF(b, a mod b) | Repeat until the remainder is zero; fold over longer lists. |
| Least common multiple | LCM(a,b) = (a/GCF(a,b)) × b | Divide before multiplying to retain exact integer arithmetic. |
| Lists containing zero | LCM(0,a) = 0; GCF(0,a) = a | The list must include at least one nonzero value. |
Questions
What is the difference between LCM and GCF?
The GCF is the largest positive whole number dividing every input. The LCM is the least common multiple, using zero when an input is zero.
Can I enter more than two numbers?
Yes, enter 2–100 whole numbers separated by commas or spaces. The calculator folds the pairwise rules across the list.
Are large integer results rounded?
No. Inputs and results use exact integers, with an output limit of 1,000 digits per value.
Sources and method
Find exact LCM and GCF for whole-number lists, with the common-factor rule and worked results. Includes explicit zero handling and large-integer support.
We use exact integer arithmetic and retain every digit of supported integer results. Diagrams are labelled explanations and are not measurement drawings.
More Math formulas
Browse Math calculatorsUpdated