Guide
GCF and LCM: recognize shared factors and multiples
Splitting different quantities into equal groups and aligning repeating cycles sound related but need different answers. The greatest common factor helps with division into groups. The least common multiple helps align repeated cycles and find common denominators for fractions.

Quick answer
The calculation at a glance
Use the GCF for the largest equal-sized groups. Use the LCM for the first shared occurrence of positive integer cycles. Prime factors explain why these two answers differ.
What matters
Compare prime powers visually
Every positive integer above 1 can be expressed as prime factors. The superscript shows how often a prime occurs. The GCF can use a prime only as many times as it appears in every input. The LCM must include the highest occurrence count.
Zero and one have special roles
The number 1 has no prime factors. If it is an input, the GCF cannot exceed 1. Zero has no prime factorization of this kind and is handled separately: the LCM becomes zero here, while a zero alongside nonzero inputs does not change their GCF.
Examples and comparisons
Shared building blocks of 12, 18 and 30
Prime factors reveal what the numbers share
Multiply the selected prime powers in each result card. A prime absent from any input cannot contribute to the GCF; the LCM keeps the largest power found anywhere. With no selected factors, the product is 1.
Load this example’s inputs in the calculator. Review them, calculate the result, then adapt the values to your own case.
Change one input
Replacing 30 with 27 halves the common factor
Direct comparison
| Scenario | Integers | Greatest common factor |
|---|---|---|
| Scenario 1 | 12; 18; 30 | 6 |
| Scenario 2 | 12; 18; 27 | 3 |
| Change from scenario 1 to scenario 2 | -3 · -50% relative | |
Also verify before making a decisionZero has no prime factorization. If any input is zero, this calculator uses LCM = 0. Individual zeros do not change the GCF of the remaining values; an all-zero list uses GCF = 0.
Assess your case
Which approach fits your question?
Calculate the GCF. It gives the largest possible shared group size; smaller common factors may also work.
For positive integer intervals, calculate the LCM. The cycles must share the same starting point.
Checklist
Before applying the answer
- All inputs are integers without thousands separators.
- The task calls for either a shared factor or a shared multiple.
- Repeating cycles use the same unit and starting point.
Common mistakes
Three common mistakes
For 12 and 18, the greatest common factor is 6 and the least common multiple is 36.
The product of positive inputs is a common multiple, but may not be the least. Shared factors can be counted more often than necessary.
This calculator accepts integers only. For time intervals, first convert every value to the same smaller unit.
Replacing 30 with 27 halves the common factor
12, 18 and 30 are all divisible by 6. Replacing only the last value with 27 removes the shared factor 2. The GCF falls to 3. The LCM answers a different question and changes from 180 to 108.
- Which prime factors occur in every input?
- Why does the GCF use the smallest shared powers, while the LCM uses the largest powers found?
- What changes for the GCF and LCM when you add a zero?
Calculator for this guide
Dividing groups or matching cycles?
Use the GCF to make equal groups without a remainder. A common denominator or coinciding repeating cycles usually calls for the LCM.How the calculation works
Calculation
Calculation method and model limits
Separate shared factors from required factors.
Remove negative signs and handle any zero using the separate zero convention.
Find how often each prime occurs in every nonzero input.
The GCF uses the smallest shared occurrence count; a nonzero LCM uses the largest count present.
A common factor must divide every input without a remainder. A positive common multiple must be divisible by every nonzero input.
Simplified formula
GCF(a, b) = GCF(b, remainder of a ÷ b). For nonzero a and b: LCM(a, b) = |a ÷ GCF(a, b) × b|. Further inputs are combined one at a time.
Scope and assumptions
The calculation itself is country-independent. Language and display choices do not change its mathematical logic.
- Calculation
- Country-independent calculation
- Applies to
- International
- Currency
- No monetary calculation
- Units
- No unit conversion needed
Questions about factors and common multiples
What is the difference between GCF and LCM?
The GCF is the greatest positive divisor shared by the inputs; the LCM is the least positive multiple shared by non-zero inputs. For 12 and 18, they are 6 and 36.
Can I enter negative integers?
Yes. The calculation uses their absolute values. Thus -12 and 18 have the same GCF and LCM as 12 and 18.
Is a very large LCM rounded?
No. Results beyond ordinary floating-point integer precision are calculated exactly and displayed in full.
We test the worked example automatically with the same logic used by the calculator. Sources, inputs, rounding and model limits are listed separately. This does not replace case-specific professional advice.
Responsible editor: Jens Marx
Formulas, input formats, examples and model limits are checked internally. No external professional review has been carried out.