Super Calculator logoSuper Calculator

LCM & GCD Calculator

Find GCD and LCM with prime factorization

Results are estimates for informational purposes only — not professional financial, medical, or legal advice. See how we build and verify our calculators.

Frequently Asked Questions

What is GCD (Greatest Common Divisor)?

The GCD (also called HCF — Highest Common Factor) is the largest number that divides all given numbers evenly. GCD(12, 18) = 6 because 6 is the largest number that divides both 12 and 18. Use the Euclidean algorithm: GCD(18,12) = GCD(12,6) = GCD(6,0) = 6.

What is LCM (Least Common Multiple)?

The LCM is the smallest positive integer that is divisible by all given numbers. LCM(4, 6) = 12 because 12 is the smallest number that both 4 and 6 divide into evenly. Key relationship: LCM(a,b) = a × b / GCD(a,b).

How do I find LCM using prime factorization?

Example: LCM(12, 18). 12 = 2^2 × 3. 18 = 2 × 3^2. LCM = take highest power of each prime: 2^2 × 3^2 = 4 × 9 = 36. GCD = take lowest power of each prime: 2^1 × 3^1 = 6. This method works for any number of inputs.

What are GCD and LCM used for?

GCD: simplifying fractions (divide numerator and denominator by GCD), finding common units, RSA cryptography. LCM: finding common denominators when adding fractions (1/4 + 1/6: LCD = LCM(4,6) = 12), scheduling repeating events, gear ratios.

What does it mean for two numbers to be coprime?

Two numbers are coprime (relatively prime) if their GCD = 1. Examples: 8 and 9 (GCD=1), 14 and 15 (GCD=1). Coprime numbers have no common prime factors. Consecutive integers are always coprime. Coprimality is important in fractions, modular arithmetic, and cryptography.

Euclidean Algorithm Example

GCD(48, 18) step by step:
GCD(48, 18): 48 = 2×18 + 12 → GCD(18, 12)
GCD(18, 12): 18 = 1×12 + 6 → GCD(12, 6)
GCD(12, 6): 12 = 2×6 + 0 → GCD = 6
GCD(48,18) = 6
LCM(48,18) = 48×18/6 = 144

Common Examples

a, bGCDLCM
6, 9318
8, 12424
14, 21742
15, 25575
17, 131221