GCF and LCM Calculator
GCF and LCM calculator
Enter at least two positive integers separated by comma, space, or newline.
InputsInteger list3 valuesLive
Live result
GCF 6 | LCM 72
Values: 12, 18, 24
Identity
gcd * lcm
= |a * b| (2 nums)
GCF
6
LCM
72
12
2 x 2 x 3
18
2 x 3 x 3
24
2 x 2 x 2 x 3
Calculation steps
- Step 1: Parse positive integers -> 12, 18, 24.
- Step 2: Reduce list with GCF operation -> 6.
- Step 3: Reduce list with LCM operation -> 72.
- Euclid 1: 12 = 18 x 0 + 12
- Euclid 2: 18 = 12 x 1 + 6
- Euclid 3: 12 = 6 x 2 + 0
- Euclid 4: GCF = 6
Formula
GCF(a b) via Euclid: gcd(a Symbol legend
| Symbol | Meaning | Unit | Copy |
|---|---|---|---|
\gcd(a,b) | Greatest common factor of integers a and b | integer | |
\operatorname{lcm}(a,b) | Least common multiple of integers a and b | integer | |
a, b | Positive input integers | integer |
- Euclid's algorithm repeatedly replaces (a, b) with (b, a mod b) until b becomes zero.
- The final non-zero value is the GCF (greatest common factor).
- LCM is derived from the product divided by GCF for each integer pair.
Example
Worked example: 12, 18, 24
- 1 Prime factors: 12=2^2 x 3, 18=2 x 3^2, 24=2^3 x 3
- 2 GCF uses shared minimum powers: 2 x 3 = 6
- 3 LCM uses shared maximum powers: 2^3 x 3^2 = 72
For 12, 18, and 24, GCF is 6 and LCM is 72.
How
- Enter at least two positive integers separated by commas or spaces.
- Review the live GCF and LCM output as you type.
- Use copy to save the result or reset to restore the default example.
Avoid
- Including decimals or fractions instead of integers.
- Using zero or negative values for a positive-integer GCF/LCM workflow.
- Assuming GCF and LCM are the same unless all values are identical.
FAQ
What is the difference between GCF and LCM?
GCF is the largest shared factor, while LCM is the smallest shared multiple.
Can I enter more than two numbers?
Yes, this calculator supports multiple positive integers and reduces across the full list.
Why are decimals rejected?
Classical GCF and LCM operations are defined for integers in this tool.
Switch
Switch12
No match.