LCM & GCD Calculator

Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD/HCF) of two or more numbers. See step-by-step solutions using Euclidean algorithm and prime factorization.

star 4.8
calculate LCM & GCD Calculator
Enter 2 or more positive integers
Parsed Numbers
12, 18
Key Relationship
LCM × GCD = a × b
For two numbers a and b
functions Results
GCD (Greatest Common Divisor)
6
Also called HCF (Highest Common Factor)
LCM (Least Common Multiple)
36
Smallest number divisible by all inputs
Verification
GCD × LCM = 6 × 36 = 216 = 12 × 18 ✓
Prime Factorization
12 = 2² × 3
18 = 2 × 3²
How it works:
GCD: Take lowest powers → 2¹ × 3¹ = 6
LCM: Take highest powers → 2² × 3² = 36
Euclidean Algorithm (GCD)
18 = 12 × 1 + 6
12 = 6 × 2 + 0
→ GCD = 6

lightbulb Tips

  • LCM × GCD = a × b
  • GCD = HCF (same thing)
  • Use Euclidean algorithm
  • GCD=1 means coprime

calculate Reference

Common GCDs
GCD(12,18)=6GCD(24,36)=12 GCD(15,25)=5GCD(48,60)=12
Key Formulas
LCM × GCD = a × b
LCM = (a × b) / GCD

How to Use This Calculator

edit

Enter Numbers

Input two or more positive integers separated by commas.

calculate

Choose Calculation

Select LCM, GCD, or both calculations.

tune

Select Method

View Euclidean algorithm, prime factorization, or both.

visibility

View Results

See LCM/GCD with step-by-step solution.

The Formula

GCD is the largest number that divides all given numbers. LCM is the smallest number divisible by all given numbers.

LCM(a,b) × GCD(a,b) = a × b

lightbulb Variables Explained

  • GCD Greatest Common Divisor
  • LCM Least Common Multiple
  • HCF Highest Common Factor (same as GCD)

tips_and_updates Pro Tips

1

GCD (Greatest Common Divisor) is also called HCF (Highest Common Factor)

2

LCM × GCD = Product of the two numbers (for 2 numbers)

3

If GCD = 1, the numbers are coprime (no common factors)

4

Use GCD to simplify fractions: divide numerator and denominator by their GCD

5

LCM is useful for finding common denominators when adding fractions

6

The Euclidean algorithm efficiently finds GCD by repeated division

LCM & GCD Calculator

Calculate the Least Common Multiple (LCM) and Greatest Common Divisor (GCD/HCF) with step-by-step solutions using Euclidean algorithm and prime factorization.

Finding GCD

The GCD is the largest positive integer that divides all given numbers without remainder. Use the Euclidean algorithm for efficient calculation: repeatedly divide and take remainders until you reach 0.

Finding LCM

The LCM is the smallest positive integer divisible by all given numbers. Calculate using prime factorization (take highest powers) or the formula: LCM = (a × b) / GCD.

Frequently Asked Questions