Enter two non-zero whole numbers.
GCD & LCM Calculator
Find the greatest common divisor and least common multiple of two non-zero integers.
Enter your values
Use the example values or replace them with your own. Required validation happens before the calculation.
Result
How to use the GCD & LCM Calculator
Follow these steps to get a reliable result and understand how it was produced.
The Euclidean algorithm finds the GCD.
The product formula gives the LCM.
Understanding the calculation
The GCD is found with the Euclidean algorithm. The LCM then follows from the product relationship.
LCM(a,b) = |a×b| ÷ GCD(a,b)The result panel substitutes your numbers into this relationship and shows the important intermediate values.
Common uses
- Reducing fractions
- Synchronising repeating cycles
- Finding common denominators
Accuracy tips
- Signs do not affect the positive GCD or LCM.
- Neither input should be zero in this calculator.
- The Euclidean algorithm is efficient even for fairly large integers.
GCD & LCM Calculator FAQs
Important details about formulas, inputs, limitations, and result interpretation.
What is GCD?
It is the largest positive integer that divides both inputs exactly.
What is LCM?
It is the smallest positive integer divisible by both inputs.
Can I enter negative integers?
Yes. The calculator uses their absolute values for GCD and LCM.
How are GCD and LCM related?
For non-zero integers, GCD×LCM = |a×b|.