🔢 LCM & GCF Calculator
Enter any set of numbers to instantly find their LCM and GCF with complete step-by-step solutions - using prime factorization, the Euclidean algorithm, and the division method. Includes a Venn diagram and the key LCM × GCF = a × b relationship. Works for two or more numbers.
🔢 Enter Numbers
Enter 2 or more numbers separated by commas or spaces.
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.
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
Example: LCM(12, 18)
GCF(12, 18) = 6
LCM = (12 × 18) / 6 = 216 / 6 = 36
Prime Factorization Method
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
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
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
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.
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.
How this calculator works, and where the numbers come from
The LCM & GCF Calculator applies the standard formula for this calculation to the values you enter and updates the result as you type. The calculation itself happens in your browser, and the page explains the method so you can check any result by hand.
Please note: Results are provided for general information and are calculated from the values you enter.