Home AI Tools About Submit Your AI

Math Tools

GCD & LCM Calculator

Free online gcd & lcm calculator. No sign-up, no installation. Runs entirely in your browser.

Input Numbers








What is GCD & LCM?

GCD (Greatest Common Divisor) is the largest positive integer that divides all the given numbers without a remainder. For example, the GCD of 48 and 18 is 6.

LCM (Least Common Multiple) is the smallest positive integer that is divisible by all the given numbers. For example, the LCM of 48 and 18 is 144.

These concepts are fundamental in mathematics, number theory, and practical applications like simplifying fractions, scheduling problems, and finding common denominators.

How to Use This Calculator

  1. Enter Your Numbers: You can input up to 6 numbers either as a comma-separated list (e.g., “48, 18, 24”) or using the individual number fields.
  2. Click Calculate: Press the “Calculate” button to instantly compute the GCD and LCM of your numbers.
  3. View Results: The calculator displays the GCD and LCM in large, easy-to-read boxes along with the step-by-step Euclidean algorithm process for the first two numbers.
  4. Copy Results: Use the “Copy Results” button to copy the GCD and LCM values to your clipboard for use elsewhere.
  5. New Calculation: Click “New Calculation” to reset and start over.

Common Use Cases

  • Simplifying Fractions: Use GCD to reduce fractions to their simplest form.
  • Finding Common Denominators: Use LCM to add or subtract fractions with different denominators.
  • Scheduling: Determine when events that occur at different intervals will align (e.g., bus schedules).
  • Pattern Problems: Solve problems involving repeating patterns or cycles.
  • Music & Rhythm: Calculate beat patterns and time signatures in music composition.
  • Number Theory: Use for cryptography, prime factorization, and mathematical proofs.

Frequently Asked Questions

What’s the difference between GCD and LCM?

GCD finds the largest number that divides all inputs, while LCM finds the smallest number that all inputs divide into. They’re complementary concepts in number theory.

Can I calculate GCD and LCM for more than 2 numbers?

Yes! This calculator supports up to 6 numbers. The algorithm chains the GCD/LCM calculations: it finds the GCD of the first two, then uses that result with the third number, and so on.

What’s the Euclidean Algorithm?

The Euclidean Algorithm is an efficient method to find GCD by repeatedly applying the division algorithm: GCD(a, b) = GCD(b, a mod b) until the remainder is 0. The last non-zero remainder is the GCD.

How is LCM calculated from GCD?

For two numbers, LCM(a, b) = (a × b) / GCD(a, b). This formula is both elegant and efficient, avoiding the need to list all multiples.

What happens if I input 0 or negative numbers?

This calculator requires positive integers. If you enter 0 or negative numbers, you’ll receive an error message asking you to input valid positive numbers only.

Can I input decimal numbers?

The GCD and LCM are defined for integers only. If you need to work with decimals, first convert them to integers (e.g., 0.5 and 0.25 → 5 and 25), calculate, then scale back if needed.

Scroll to Top