GCD, LCM & Prime Factorization Calculator (Venn Diagram)

Find Greatest Common Divisor, Least Common Multiple, and prime factors with a live Venn diagram showing shared primes.

Input Parameters

ℹ️ Format: Two positive integers (1 to 1,000,000,000) · e.g. 36, 48
Dimensions

💡 Tip: You can also paste (12, 13, 14) directly into any box.

GCD & LCM
GCD 12 | LCM 144
GCD
12
LCM
144
Prime Factors (A)
2 × 2 × 3 × 3
Prime Factors (B)
2 × 2 × 2 × 2 × 3
✨ Auto-scaled live diagram

Formula & Step-by-Step Calculation

LCM(a, b) = |a × b| / GCD(a, b)
  1. 1
    Prime factorization
    36 = 2 × 2 × 3 × 3, 48 = 2 × 2 × 2 × 2 × 3
  2. 2
    Multiply shared prime factors
    GCD = product of shared primes (2 × 2 × 3) = 12
  3. 3
    Compute LCM = (a × b) / GCD
    LCM = (36 × 48) ÷ 12 = 144
\gcd(36, 48) = 12,\quad \operatorname{lcm}(36, 48) = 144

Embed This Calculator (Free)

Copy this HTML snippet to embed this interactive calculator on your blog, course, or website.

Worked Example

Sample inputs and verified result: Integer A = 36, Integer B = 48

GCD & LCM: GCD 12 | LCM 144

Frequently Asked Questions

How are GCD and LCM related?

For any two positive integers a and b, GCD(a, b) × LCM(a, b) = a × b.