Enter two integers to find their GCD (greatest common factor) and LCM instantly.
Enter two integers to find their Greatest Common Divisor and Least Common Multiple. The GCD is the largest number that divides both evenly. The LCM is the smallest number both divide into. Both are used constantly in fraction work and divisibility problems.
The Greatest Common Divisor (GCD) is the largest number that divides both integers without a remainder. The Least Common Multiple (LCM) is the smallest number that both integers divide into evenly. These are fundamental tools in fraction simplification, scheduling problems, and number theory.
You came here because
Common situations
- Simplifying fractions: Divide numerator and denominator by their GCD to reduce to lowest terms. 48/18 → 8/3.
- Finding common denominators: LCM of the denominators is the least common denominator for adding fractions.
- Scheduling problems: Two events repeat every 6 and 8 days. They next coincide after LCM(6,8) = 24 days.
- Tile and grid problems: Find the largest square tile that fits evenly in a rectangular room using GCD of dimensions.
Under the hood
How the calculation works
- 1Enter two positive integers.
- 2The calculator applies the Euclidean algorithm: divide the larger by the smaller, take the remainder, repeat.
- 3When the remainder is zero, the last divisor is the GCD.
- 4LCM is computed from LCM = (a × b) / GCD.
Show me
A real example
Example: GCD(48, 18)
- 148 mod 18 = 12 → GCD(18, 12)
- 218 mod 12 = 6 → GCD(12, 6)
- 312 mod 6 = 0 → GCD = 6
- 4LCM = (48 × 18) / 6 = 864 / 6 = 144
Watch out for
What can go wrong
- Expecting GCD to work with decimals or fractions: The GCD is defined for integers only. If you have 2.5 and 5, convert to a common form first (e.g., multiply both by 2 to get 5 and 10, GCD = 5). The calculator requires whole numbers.
- Confusing GCD with LCM: GCD is the largest number that divides both evenly. LCM is the smallest number both divide into. GCD is used to simplify fractions; LCM is used to find common denominators when adding them.
- Entering zero: GCD(0, n) = n by mathematical convention. Some calculators handle this; others do not. If you enter zero, the result is the other number. This is correct but rarely what you intended.
- Entering negative numbers: GCD is defined for positive integers. For negative inputs, most algorithms use the absolute value. Check that your calculator returns the expected result if you enter negative numbers.
Glossary
Related concepts
| Term | Definition |
|---|---|
| Euclidean algorithm | An efficient method for computing GCD, dating back to ancient Greece. Based on the property GCD(a, b) = GCD(b, a mod b). |
| Coprime numbers | Two numbers are coprime (relatively prime) if their GCD is 1. Example: 14 and 15 are coprime. |
| Least Common Multiple (LCM) | The smallest positive integer divisible by both numbers. Equals (a × b) / GCD. |
| Prime factorization | Another way to find GCD and LCM: break each number into prime factors, then find the common and combined factors. |
Make it better
Pro tips
- Use GCD to simplify fractions instantly: Divide both numerator and denominator by their GCD to reduce a fraction to lowest terms. GCD(18, 24) = 6, so 18/24 = 3/4.
- Use LCM to find common denominators: To add 1/6 + 1/4, find LCM(6, 4) = 12. Then convert both fractions to twelfths: 2/12 + 3/12 = 5/12.
- Verify by testing divisibility: If the GCD of 48 and 60 is 12, then 48 ÷ 12 = 4 and 60 ÷ 12 = 5 should both be whole numbers. If not, the GCD is wrong.
- Use for scheduling problems: Two events that repeat every 8 and 12 days will next occur on the same day after LCM(8, 12) = 24 days. LCM solves alignment and synchronization problems in scheduling, gears, and timing systems.
Common questions
Frequently asked questions
For related calculations, try the Fraction Calculator, Percentage Calculator, or Quadratic Formula. Browse all Calculator Online calculators for the full catalog.
Methodology
This calculator uses the standard gcd calculator formula. Results match those from established financial, scientific, and health references.
Reviewed by
Calculator Online Editorial Team. All formulas verified against authoritative sources before publication.
Last updated
2026-01-15