GCD & LCM Calculator
Find the Greatest Common Divisor and Least Common Multiple of two numbers.
Calculation Result
How to Find GCD and LCM
The Greatest Common Divisor (GCD) and Least Common Multiple (LCM) are useful when working with whole numbers, factors, multiples and fractions. This calculator finds both values for two positive whole numbers.
GCD and LCM Formula
The GCD is the largest positive integer that divides both numbers without a remainder. The LCM is the smallest positive integer that is divisible by both numbers.
For two positive numbers, the relationship between GCD and LCM can be expressed as:
GCD × LCM = First Number × Second Number
Example: GCD and LCM of 12 and 18
The factors of 12 include 1, 2, 3, 4, 6 and 12, while the factors of 18 include 1, 2, 3, 6, 9 and 18. The greatest common divisor is therefore 6.
The smallest positive number that is a multiple of both 12 and 18 is 36, so the LCM is 36.
Common Uses of GCD and LCM
GCD and LCM are commonly used in mathematics, fraction calculations, number theory, scheduling problems and situations where quantities need to be divided or combined into equal groups.
GCD & LCM Calculator FAQs
What is the GCD of 12 and 18?
The GCD of 12 and 18 is 6.
What is the LCM of 4 and 6?
The LCM of 4 and 6 is 12.
Can this calculator calculate GCD and LCM for decimals?
No. This calculator is designed for positive whole numbers and checks that both inputs are integers before calculating the results.
Can I enter zero?
No. The calculator requires positive whole numbers greater than zero. Entering zero or a negative number displays a validation message.
Use the free GCD & LCM Calculator above to quickly find the greatest common divisor and least common multiple of two positive whole numbers.