Mathematics Calculators

LCM & GCD Calculator

Computes GCD via the Euclidean algorithm and LCM for lists of positive integers. Shows prime factorization context and verifies the identity LCM × GCD = a × b for two numbers.

1 Input Parameters

All fields validated

Positive integers separated by commas or spaces

2 Calculation Result

Instant Calculation
GCD & LCM GCD: 6 | LCM: 36
Numbers: 12, 18
GCD: 6
LCM: 36
Verification (GCD × LCM = a × b): 216 = 216
Step-by-Step Breakdown:
  1. GCD of 12, 18 = 6 (Euclidean algorithm).
  2. LCM of 12, 18 = 36.

Formula Used for Calculation

gcd(a,b) via Euclidean: gcd(a,b) = gcd(b, a mod b), gcd(a,0) = a | lcm(a,b) = |a × b| / gcd(a,b)

For multiple numbers, GCD and LCM are computed iteratively (pairwise reduction). Displays Euclidean algorithm steps and verifies LCM × GCD = a × b for two-number inputs.

Concrete Example Calculation

12, 18 → GCD = 6, LCM = 36. Verification: 6 × 36 = 216 = 12 × 18.

Important Information & Limitations

Accepts positive integers only. Zero is not allowed for LCM. At least two numbers required. Very large results may exceed safe integer limits.

Frequently Asked Questions

What is the difference between GCD and LCM?

GCD (Greatest Common Divisor) is the largest number dividing all inputs. LCM (Least Common Multiple) is the smallest number divisible by all inputs.

Can I enter more than two numbers?

Yes. Enter any count of positive integers separated by commas or spaces; GCD and LCM are computed across the whole list.

Explore complementary tools and calculations in this domain.

All Calculators