LCM & GCF Calculator
Simplifying fractions and solving number problems starts with factors. Enter two or more numbers and this calculator finds the greatest common factor and the least common multiple instantly, showing the prime factorization behind each answer.
Negative numbers use their absolute value. With zero, GCF = the other number and LCM = 0.
Enter at least two numbers — the result appears here live.
How it works
The GCF comes from the Euclidean algorithm: divide the bigger number by the smaller one and keep the remainder, repeating until the remainder is 0. The LCM formula is: LCM = a × b ÷ GCF. With three or four numbers, the same step is applied to each number one by one.
Example 1: 12 and 18 — 12 = 2² × 3, 18 = 2 × 3² — GCF = 6, LCM = 12 × 18 ÷ 6 = 36.
Example 2: 8 and 14 have GCF = 2, so LCM = 8 × 14 ÷ 2 = 56. The LCM is used as a common denominator for adding fractions, and the GCF for simplifying them.
How to use
- Type at least two numbers in the boxes — two more boxes are optional.
- The result updates automatically; there is no button to press.
- Read the GCF and LCM values and check the prime factorization steps below them.