GCD & LCM Calculator
Find the Greatest Common Divisor and Least Common Multiple of two positive whole numbers.
Calculate GCD and LCM
Enter two positive whole numbers to calculate their GCD and LCM instantly.
Calculation Results
Calculation Steps
What Are GCD and LCM?
GCD and LCM are important mathematical concepts used with whole numbers, factors and multiples. The GCD is the largest positive integer that divides two numbers without a remainder. The LCM is the smallest positive integer that is divisible by both numbers.
GCD Formula
The Greatest Common Divisor (GCD), also called the Greatest Common Factor (GCF), is the largest number that divides both input numbers exactly.
LCM Formula
The Least Common Multiple is the smallest positive number that is a multiple of both input numbers.
This relationship is used by the calculator to find the LCM after calculating the GCD.
Example: Find the GCD and LCM of 12 and 18
The factors of 12 are 1, 2, 3, 4, 6 and 12. The factors of 18 are 1, 2, 3, 6, 9 and 18. Their greatest common factor is 6.
The multiples of 12 include 12, 24, 36 and 48. The multiples of 18 include 18, 36 and 54. Their smallest common multiple is 36.
How Does the Euclidean Algorithm Work?
The Euclidean algorithm is an efficient method for finding the GCD of two positive integers. Divide the larger number by the smaller number and replace the pair with the smaller number and the remainder. Repeat until the remainder is zero. The last non-zero remainder is the GCD.
For example, to find the GCD of 48 and 18:
- 48 ÷ 18 = 2 remainder 12
- 18 ÷ 12 = 1 remainder 6
- 12 ÷ 6 = 2 remainder 0
Therefore, the GCD of 48 and 18 is 6.
Common Uses of GCD and LCM
- Simplifying fractions to their lowest terms.
- Finding common denominators when adding or subtracting fractions.
- Solving mathematical and number theory problems.
- Working out repeating schedules and events.
- Dividing quantities into equal groups.
Frequently Asked Questions
What does GCD stand for?
GCD stands for Greatest Common Divisor. It is the largest positive integer that divides two or more numbers without a remainder.
What does LCM stand for?
LCM stands for Least Common Multiple. It is the smallest positive integer that is divisible by two or more numbers.
What is the GCD of 12 and 18?
The GCD of 12 and 18 is 6 because 6 is their greatest common factor.
What is the LCM of 4 and 6?
The LCM of 4 and 6 is 12 because 12 is the smallest positive number divisible by both 4 and 6.
Can I calculate GCD and LCM for decimal numbers?
This calculator accepts positive whole numbers only. Decimal values and fractions are not accepted.
Can I enter zero or negative numbers?
No. Both inputs must be positive whole numbers greater than zero.
Can this calculator handle very large numbers?
Yes. It uses JavaScript BigInt arithmetic to calculate GCD and LCM accurately for very large whole numbers supported by your browser.
Related Math Calculators
Explore more free online math tools:
Percentage Calculator | Fraction Calculator | Ratio Calculator | Average Calculator | Prime Number Checker