Math

LCM and GCD Calculator

Compute the Least Common Multiple and Greatest Common Divisor of two or more positive integers, with prime factorization.

GCD

6

Greatest Common Divisor

LCM

72

Least Common Multiple

▶ Show prime factorization
12=2^2 × 3
18=2 × 3^2
24=2^3 × 3

What is LCM and GCD Calculator?

Computes the LCM (Least Common Multiple) and GCD (Greatest Common Divisor) of two or more numbers. LCM: smallest number that all numbers divide into. GCD: largest number that divides all of them. Show up in fraction addition, simplification, proportional division and school arithmetic.

How to use

  1. Type numbers separated by comma or space.
  2. See LCM and GCD computed in real time.
  3. Prime factor breakdown is shown too.
  4. Works with any number of inputs.

Frequently asked questions

What is the difference between LCM and GCD?

GCD is the largest number that divides every input exactly. LCM is the smallest number that is a multiple of every input.

How are they calculated?

GCD uses the Euclidean algorithm pairwise across the list. LCM uses the identity LCM(a, b) = |a × b| / GCD(a, b), applied pairwise.

Can I enter more than two numbers?

Yes — separate them with commas, spaces or semicolons. The calculator works on any number of positive integers (minimum 2).

Related tools