LCM & GCF Calculator

Calculate the Least Common Multiple and Greatest Common Factor of numbers.

LCM & GCF Calculator

How to Use

1

Enter your numbers

Type two or more integers separated by commas or spaces into the input field.

2

Calculate LCM and GCF

Click calculate to compute both the Least Common Multiple and Greatest Common Factor simultaneously.

3

Review both results

LCM is the smallest shared multiple; GCF is the largest shared factor of all entered numbers.

4

Apply to fractions or scheduling

Use LCM for adding fractions (common denominator) and GCF for simplifying fractions or equal grouping.

What are LCM and GCF?

The Least Common Multiple (LCM) is the smallest positive integer that is divisible by a given set of numbers. The Greatest Common Factor (GCF) is the largest positive integer that divides the numbers without a remainder.

Real-World Examples & Use Cases

Adding and Subtracting Fractions

To add fractions with different denominators, you need the Least Common Denominator (LCD) — which is the LCM of the denominators. Adding 1/4 + 1/6: LCM(4, 6) = 12. Convert: 3/12 + 2/12 = 5/12. Without finding the LCM first, students may use a common denominator that is not the smallest (e.g., 24 instead of 12), leading to correct but unnecessarily large fractions that require additional simplification. LCM calculation makes fraction arithmetic efficient and produces simplified results directly.

Simplifying Fractions to Lowest Terms

To simplify a fraction, divide numerator and denominator by their GCF. Simplifying 48/72: GCF(48, 72) = 24. Divide both by 24: 2/3. Without the GCF, repeated manual simplification steps are required, and you may not reach the fully reduced form in one step. This approach is essential for students learning fractions and for any application requiring fractions in their simplest form: measurements, probability ratios, and mathematical proofs.

Scheduling Repeating Events

LCM solves scheduling problems where two events repeat at different intervals and you need to find when they coincide. Event A repeats every 6 days; Event B repeats every 8 days. LCM(6, 8) = 24 days until they coincide again. More complex scenarios: a bus arriving every 15 minutes and a train every 25 minutes both arrive together every LCM(15, 25) = 75 minutes. This applies to manufacturing cycles, maintenance schedules, software polling intervals, and shift rotation planning.

Distributing Items into Equal Groups

GCF determines the maximum equal group size when distributing different quantities. You have 36 apples and 48 oranges; you want to create identical bags with the same combination in each. GCF(36, 48) = 12 — so you can make 12 identical bags, each with 3 apples (36/12) and 4 oranges (48/12). Party planning, resource distribution in operations, tile pattern design, and classroom activity grouping all use GCF to find the maximum equal subdivision of multiple quantities.

How It Works

Two algorithms compute GCF and LCM: GCF (Euclidean Algorithm — most efficient): GCF(a, b) = GCF(b, a mod b), stopping when remainder = 0 Example: GCF(48, 18) → GCF(48, 18) = GCF(18, 12) = GCF(12, 6) = GCF(6, 0) = 6 For multiple numbers: GCF(a, b, c) = GCF(GCF(a, b), c) LCM (using GCF): LCM(a, b) = |a × b| / GCF(a, b) Example: LCM(12, 15) → GCF(12, 15) = 3; LCM = (12 × 15) / 3 = 60 For multiple numbers: LCM(a, b, c) = LCM(LCM(a, b), c) Prime factorization method: GCF = product of minimum powers of all common prime factors LCM = product of maximum powers of all prime factors Example: 12 = 2²×3, 18 = 2×3² GCF = 2¹×3¹ = 6; LCM = 2²×3² = 36

Frequently Asked Questions

What is the relationship between LCM and GCF?
For any two positive integers a and b: LCM(a, b) × GCF(a, b) = a × b. This relationship allows you to calculate one if you know the other: LCM = (a × b) / GCF. This property only holds for exactly two numbers — for three or more numbers, LCM and GCF must be computed step by step and there is no equivalent simple product relationship.
What is the LCM or GCF of co-prime numbers?
Co-prime numbers share no common factors other than 1. For co-prime numbers: GCF = 1 (they have no shared prime factors). LCM = a × b (their product, since there are no shared factors to cancel). Examples: GCF(7, 13) = 1; LCM(7, 13) = 91. GCF(4, 9) = 1; LCM(4, 9) = 36. Consecutive integers are always co-prime: GCF(n, n+1) = 1 for all positive integers n.
What is the GCF of a number and zero?
The GCF of any number n and 0 is n itself (GCF(n, 0) = n), because every integer divides zero. This is a mathematical convention that makes the Euclidean algorithm work cleanly — the algorithm terminates when the remainder reaches zero, and the last non-zero value is the GCF. In practice, GCF calculations always involve two positive integers, so this edge case is mostly theoretical.
Is GCF the same as HCF?
Yes. GCF (Greatest Common Factor) and HCF (Highest Common Factor) are the same calculation with different names used in different regions or curricula. Both describe the largest positive integer that divides all given numbers without a remainder. American mathematics curricula typically use GCF; British and some Commonwealth curricula use HCF. GCD (Greatest Common Divisor) is another equivalent term used in computer science and number theory.
Can LCM and GCF be calculated for more than two numbers?
Yes. The standard approach applies the two-number formula iteratively. GCF(a, b, c) = GCF(GCF(a, b), c). LCM(a, b, c) = LCM(LCM(a, b), c). This extends to any number of inputs. Example: LCM(4, 6, 10): LCM(4, 6) = 12; LCM(12, 10) = 60. This is the smallest number divisible by all three. Our calculator handles multiple inputs directly, applying this iterative method automatically.

Related Tools

Explore other tools in this category.

Looking for something else?