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

First pair: 12, 1812 mod 18 = 12GCF = 6LCM = 36

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.

Editable worked example
Values:
  1. Input integers: 12, 18
  2. 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.

Calculator inputs
Least common multiple (LCM)
36
Greatest common factor (GCF / HCF)
6

Formula variants

Related formulas and when to use them
Shape or methodFormulaMeaning
Greatest common factorGCF(a,b) = GCF(b, a mod b)Repeat until the remainder is zero; fold over longer lists.
Least common multipleLCM(a,b) = (a/GCF(a,b)) × bDivide before multiplying to retain exact integer arithmetic.
Lists containing zeroLCM(0,a) = 0; GCF(0,a) = aThe 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 calculators

Updated