What is GCD/LCM Calculator?
GCD/LCM Calculator computes the Greatest Common Divisor and Least Common Multiple for two or more numbers. You also get the step-by-step Euclidean algorithm and prime factorizations, useful for math homework, engineering, and programming.
Enter any positive integers separated by commas or spaces and the result includes the GCD, LCM, the prime factorization of each input, and the Euclidean algorithm trace showing each division step. The factorization view is what most homework grading systems want to see alongside the final answer.
How to use
- Step 1 — Enter two or more positive integers separated by commas.
- Step 2 — View the GCD and LCM results along with the prime factorization of each number.
- Step 3 — Copy the results or add more numbers to compute GCD/LCM for a larger set.
When to use
- Reducing fractions to lowest terms by dividing numerator and denominator by their GCD.
- Finding the lowest common denominator when adding fractions with different denominators.
- Working out when two repeating events line up — bus schedules, gear teeth, factory shift cycles.
Result
Finding the GCD and LCM of 48 and 180: GCD = 12, LCM = 720, with prime factorizations 48 = 2⁴ × 3 and 180 = 2² × 3² × 5.
FAQ
- What's the difference between GCD and LCM?
- The Greatest Common Divisor is the largest number that divides every input without remainder. The Least Common Multiple is the smallest number that every input divides into without remainder. For 12 and 18, GCD = 6, LCM = 36.
- Can I find the GCD or LCM of more than two numbers?
- Yes. Enter as many positive integers as you need, comma- or space-separated. The tool computes GCD and LCM pairwise across the full list. For GCD, that's gcd(gcd(a,b), c); for LCM, lcm(lcm(a,b), c).
- Why do you show the Euclidean algorithm steps?
- Math classes that cover number theory often expect students to demonstrate each division step, not just the final GCD. The trace shows each substitution (a = q×b + r) so you can copy it into a homework answer or check your own work.
- How does GCD relate to prime factorization?
- The GCD is the product of the lowest powers of each prime that appears in every input. The LCM is the product of the highest powers. The factorization columns make that relationship visible — useful when teaching the concept.
- Are negative numbers or zero supported?
- The calculator filters input to positive integers only. GCD with negatives is conventionally taken as the absolute value, and gcd(n, 0) equals |n|, but those edge cases rarely matter in practice so they're left out to keep the output clean.
Related Tools
Regression Calculator
Perform linear and polynomial regression analysis
Matrix Calculator
Perform matrix operations and calculations
Chi-Square Calculator
Perform chi-square statistical tests
Graphing Calculator
Plot mathematical functions on a graph
Area Calculator Map
Draw shapes on a map to calculate area
Z-Score Calculator
Calculate z-scores, percentiles, and probabilities