🔢 Enter Numbers

Enter 2 or more numbers separated by commas or spaces.

Try:

🔍 Prime Number Checker

Check if a number is prime and see its factors.

📋 First 50 Prime Numbers

📐 LCM & GCF Formulas

GCF - Euclidean Algorithm

The fastest method to find GCF of two numbers.

GCF(a, b):
while b ≠ 0:
temp = b
b = a mod b
a = temp
return a

Example: GCF(48, 18)
48 mod 18 = 12 → GCF(18, 12)
18 mod 12 = 6 → GCF(12, 6)
12 mod 6 = 0 → GCF = 6

LCM using GCF

LCM(a, b) = |a × b| / GCF(a, b)

Example: LCM(12, 18)
GCF(12, 18) = 6
LCM = (12 × 18) / 6 = 216 / 6 = 36

Prime Factorization Method

GCF = product of COMMON prime factors (lowest powers)
LCM = product of ALL prime factors (highest powers)

Example: 12 = 2² × 3 18 = 2 × 3²

GCF = 2¹ × 3¹ = 6 (min of each power)
LCM = 2² × 3² = 36 (max of each power)

Multiple Numbers LCM/GCF

GCF(a,b,c) = GCF(GCF(a,b), c)
LCM(a,b,c) = LCM(LCM(a,b), c)

Example: GCF(8, 12, 20)
GCF(8,12) = 4, then GCF(4,20) = 4

Real-World Uses

LCM: When do two repeating events coincide?
→ Bus A every 12 min, Bus B every 18 min
→ LCM(12,18) = 36 min → meet every 36 min

GCF: Largest equal pieces you can cut?
→ 48cm and 18cm ribbons → GCF=6 → 6cm pieces
→ Fractions: simplify 12/18 → divide by GCF(12,18)=6 → 2/3

❓ Frequently Asked Questions

🤖
AI Insights - Coming Soon!
AI-powered step explanations, word problem solving, and real-world LCM/GCF applications.
Coming Soon - Stay Tuned!

LCM & GCF Calculator - Least Common Multiple and Greatest Common Factor Explained

LCM and GCF are two of the most frequently used concepts in number theory and everyday arithmetic - from simplifying fractions and adding unlike denominators, to scheduling problems and sharing objects equally into groups. Understanding both numbers and the methods to find them builds mathematical confidence that extends well beyond these two operations.

Key relationship: For any two numbers a and b: LCM(a,b) × GCF(a,b) = a × b. Example: LCM(12,18) = 36 and GCF(12,18) = 6. Check: 36 × 6 = 216 = 12 × 18 ✓. This means if you know any three of the four values (a, b, LCM, GCF), you can always calculate the fourth.

Three Methods to Find LCM and GCF

Prime Factorization Method

  • Factorise each number into primes
  • GCF: take the LOWEST power of each prime common to ALL numbers
  • LCM: take the HIGHEST power of each prime across ANY number
  • Example: 12 = 2² × 3, 18 = 2 × 3²
  • GCF = 2¹ × 3¹ = 6
  • LCM = 2² × 3² = 36
  • Best for showing the relationship visually

Euclidean Algorithm (GCF) & LCM From GCF

  • GCF: divide larger by smaller, replace larger with remainder. Repeat until remainder = 0.
  • GCF(48,18): 48 mod 18 = 12 → 18 mod 12 = 6 → 12 mod 6 = 0 → GCF = 6
  • Then LCM = (a × b) ÷ GCF = (48 × 18) ÷ 6 = 144
  • Most efficient method for large numbers
  • Used by most programming implementations

Real-World Uses of LCM and GCF

LCM and GCF appear in practical contexts more often than many students realise:

  • Adding fractions with different denominators: To add 1/4 + 1/6, find LCM(4,6) = 12 as the common denominator. Then 3/12 + 2/12 = 5/12. The LCM gives the smallest common denominator, keeping numbers manageable.
  • Simplifying fractions: To simplify 18/24, find GCF(18,24) = 6. Then 18÷6 / 24÷6 = 3/4. GCF gives the exact reduction factor.
  • Scheduling repeating events: If event A happens every 8 days and event B happens every 12 days, they coincide every LCM(8,12) = 24 days.
  • Equal distribution: Dividing 36 apples and 48 oranges into the largest equal groups without remainder: GCF(36,48) = 12. Each group gets 3 apples and 4 oranges.
  • Tile fitting: To tile a floor of 6m × 10m with the largest possible square tiles: GCF(6,10) = 2. Use 2m × 2m tiles.

Coprime Numbers - When GCF = 1

Two numbers are coprime (or relatively prime) if their GCF is 1 - they share no common prime factors. Examples: 8 and 15 (8 = 2³, 15 = 3 × 5 - no shared primes), 14 and 25, 9 and 16.

Coprime numbers have a special property: their LCM equals their product. LCM(8,15) = 8 × 15 = 120 (since GCF = 1, so LCM = a × b ÷ 1 = a × b). Consecutive integers are always coprime - GCF(n, n+1) = 1 for any positive integer n, which is why fractions like 7/8 and 11/12 are already in their simplest form.

LCM and GCF for Three or More Numbers

For three or more numbers, apply the operation iteratively. For GCF: GCF(a,b,c) = GCF(GCF(a,b), c). For LCM: LCM(a,b,c) = LCM(LCM(a,b), c). This is the same principle as the two-number case, applied step by step.

Example: LCM(4,6,10). Step 1: LCM(4,6) = 12. Step 2: LCM(12,10) = 60. So LCM(4,6,10) = 60. Verify: 60 ÷ 4 = 15 ✓, 60 ÷ 6 = 10 ✓, 60 ÷ 10 = 6 ✓. This calculator handles any number of inputs using this iterative approach automatically.