🧰 ToolPicoAll Tools →
Step-by-step solution · 2-6 numbers

GCF & LCM Calculator

Find the greatest common factor (GCF / GCD) and least common multiple (LCM) of 2 to 6 whole numbers instantly — with step-by-step prime factorization, division ladder, and Euclidean algorithm methods.

Runs entirely in your browser 4 solving methods Free, no sign-up Updated: Jul 19, 2026
Enter the whole numbers to calculate (at least 2, at most 6):
⚙️ Display settings — common factors, verification, default method
List common factorsShow all common factors of the numbers
GCF × LCM verificationShow the product check for two numbers
Quick answer The GCF (greatest common factor, also called the GCD) is the largest number that divides every given number with no remainder; the LCM is the smallest number that every given number divides into evenly. For 12 and 18: GCF = 6 and LCM = 36. For two numbers, GCF × LCM always equals the product of the two numbers.
6GCF(12, 18)
36LCM(12, 18)
12GCF(24, 36, 48)
144LCM(24, 36, 48)
ℹ️ How it works: This tool runs entirely in your browser; no data is sent to a server. The GCF and LCM are computed exactly and algorithmically using four methods (prime factorization, the division ladder method, listing multiples, and the Euclidean algorithm). Enter whole numbers between 1 and 1,000,000,000; decimals and zero are ignored.

What are the GCF and LCM, and how do you calculate them?

A complete guide — with formulas and examples — to the greatest common factor (GCF/GCD), the least common multiple (LCM), four solving methods, and the relationship between them.

The GCF (Greatest Common Factor) is the largest number that divides two or more whole numbers with no remainder; in computer science and higher mathematics it's usually called the GCD (Greatest Common Divisor) — the two terms mean exactly the same thing. The LCM (Least Common Multiple) is the smallest positive number that all of those numbers divide into evenly. The calculator above solves both, with four independent methods so you can see how each one reaches the same answer.

How do you find the GCF? (prime factorization method)

Quick answerBreak each number into its prime factors, keep the factors that are common to all of them, and multiply using the lowest power each one appears with. For example, 12 = 2² × 3 and 18 = 2 × 3² share the primes 2 and 3; using their lowest powers, 2¹ × 3¹ = 6. You can also use the Euclidean algorithm: 18 = 12×1 + 6, 12 = 6×2 + 0 → GCF = 6.
  • Prime factorization method: multiply the common primes using their lowest powers.
  • Division ladder method: write the primes that divide all the numbers at once down the left side; their product is the GCF.
  • Listing multiples method: write out each number's multiples until one appears in every list — that's the LCM.
  • Euclidean algorithm: divide the larger number by the smaller one and repeat with the remainder until it hits zero; the last divisor is the GCF (fastest for large numbers).

How do you calculate the LCM?

Quick answerTake every prime factor that appears in any of the numbers, using its highest power, and multiply them together. For 12 = 2² × 3 and 18 = 2 × 3², LCM = 2² × 3² = 36. Handy shortcut for two numbers: LCM = (Number1 × Number2) / GCF.

What is the relationship between the GCF and the LCM?

Quick answerFor two numbers, GCF × LCM equals the product of the two numbers. For 12 and 18: GCF = 6, LCM = 36, and 6 × 36 = 216 = 12 × 18. This relationship only holds for two numbers at a time — the calculator automatically verifies it whenever you enter exactly two.

What does relatively prime (coprime) mean?

Quick answerIf the numbers' GCF is 1, they're relatively prime (or coprime): they share no common factor besides 1 (e.g. 8 and 15). In that case the LCM equals the direct product of the numbers. The numbers themselves don't need to be prime — the calculator flags this with a badge whenever GCF comes out to 1.

Common GCF & LCM examples

Tap any example below and the calculator will fill it in and solve it step by step automatically.

Example numbers and their results
NumbersGCFLCM
12 and 18636
24 and 361272
8 and 12424
15 and 25575
8 and 15 (relatively prime)1120
24, 36, and 4812144
6, 8, and 9172

Popular calculations

Related mini calculators: fractions, sync problems & factors

The three most common everyday uses of GCF and LCM — all instant, all in your browser.

Fraction simplifier
Reduces a fraction to lowest terms by dividing numerator and denominator by their GCF.
🔁Common-cycle finder
Finds how often two repeating events (LCM) will next line up at the same time.
🔢Factors of a number
Lists every positive factor of a number and tells you how many there are.

Reference tables & handy facts

Evergreen tables you'll want for GCF / LCM work: divisibility rules, prime numbers, and a GCF-vs-LCM comparison.

Divisibility rules — useful when finding prime factors
DivisorRule
2Divisible by 2 if the last digit is even (0, 2, 4, 6, 8).
3Divisible by 3 if the digit sum is divisible by 3.
4Divisible by 4 if the last two digits are divisible by 4 (or are 00).
5Divisible by 5 if the last digit is 0 or 5.
6Divisible by 6 if it's divisible by both 2 and 3.
8Divisible by 8 if the last three digits are divisible by 8.
9Divisible by 9 if the digit sum is divisible by 9.
10Divisible by 10 if the last digit is 0.

These rules quickly tell you which prime to try first when factoring a number.

Prime numbers up to 100 (useful when testing prime factors)
RangePrime numbers
1 – 302, 3, 5, 7, 11, 13, 17, 19, 23, 29
31 – 6031, 37, 41, 43, 47, 53, 59
61 – 10061, 67, 71, 73, 79, 83, 89, 97

A prime number is only divisible by 1 and itself. 1 is not prime; 2 is the smallest prime and the only even one.

Key differences between the GCF and the LCM
PropertyGCF (GCD)LCM
MeaningGreatest common factorLeast common multiple
Result sizeLess than or equal to the numbersGreater than or equal to the numbers
Prime exponentsCommon primes, lowest powerAll primes, highest power
Typical useSimplifying fractions, groupingCommon denominators, sync/cycle problems
2-number relationshipGCF × LCM = Number1 × Number2

For relatively prime numbers, GCF = 1 and LCM equals the product of the numbers.

GCF & LCM terms glossary

Short definitions of the core terms used in GCF and LCM problems.

GCF / GCDGreatest common factor (or greatest common divisor): the largest number that divides all the given numbers with no remainder.
LCMLeast common multiple: the smallest positive number that all the given numbers divide into with no remainder.
Prime numberA number greater than 1 that is only divisible by 1 and itself (2, 3, 5, 7 ...).
Prime factorA prime number that divides a given number. Prime factorization writes a number as a product of primes.
Factor (divisor)A number that divides another number with no remainder. The factors of 12 are 1, 2, 3, 4, 6, 12.
MultipleA number's product with an integer. The multiples of 4 are 4, 8, 12, 16 ...
Common factorA number that divides two or more numbers at once. The largest one is the GCF.
Common multipleA multiple shared by two or more numbers. The smallest one is the LCM.
Relatively prime (coprime)Numbers whose GCF is 1 — they share no common factor besides 1 (e.g. 9 and 10).
Euclidean algorithmA fast way to find the GCF using repeated division with remainder.

Example problems & in-depth guides

Typical exam and real-world problems involving the GCF and the LCM.

LCM word problem: when do two buses depart together again?

Bus A leaves a stop every 12 minutes, and Bus B leaves every 18 minutes. If they both left together at 8:00, when will they next depart together? Take the LCM of the two cycles: LCM(12, 18) = 36. So they'll depart together again in 36 minutes, at 8:36.

Any "repeat together / sync / lap" problem like this always uses the LCM. Try 12 and 18 in the "Common-cycle finder" mini tool above to check the answer.

GCF word problem: splitting pencils into the largest equal groups

You have 24 red pencils and 36 blue pencils. You want to make the largest possible equal-sized packs, with no pencils left over and only one color per pack. The largest number of pencils per pack is GCF(24, 36) = 12. That gives 2 red packs + 3 blue packs = 5 packs total.

Phrases like "split evenly among the most people" or "the largest equal parts" are a signal to use the GCF.

How is the GCF used to simplify fractions?

To reduce a fraction to lowest terms, divide the numerator and denominator by their GCF. For 24/36, GCF(24, 36) = 12; dividing both by 12 gives 2/3. If the GCF comes out to 1, the fraction is already fully simplified (the numerator and denominator are relatively prime).

The "Fraction simplifier" mini tool above does this automatically and shows the GCF it used.

Add this calculator to your site (embed code)

Embed the GCF & LCM calculator on your own website for free. Copy the code below into your HTML — the tool runs in a simplified view and links back to this page as its source.

The embedded tool has a fixed layout; you can adjust the height value to fit your site. No ads or personal data, runs entirely client-side.

Frequently asked questions

How do you find the GCF of two or more numbers?
Break each number into its prime factors, then multiply the common prime factors using their lowest powers. For example, 12 = 2² × 3 and 18 = 2 × 3² share the primes 2 and 3; GCF = 2¹ × 3¹ = 6. Alternatively, use the Euclidean algorithm: divide the larger number by the smaller one repeatedly until the remainder is zero — the last divisor is the GCF.
How do you calculate the LCM?
Take every prime factor that appears in any of the numbers, using its highest power, and multiply them. 12 = 2² × 3 and 18 = 2 × 3² give LCM = 2² × 3² = 36. Shortcut for two numbers: LCM = (Number1 × Number2) / GCF.
What's the difference between GCD and GCF?
There's no difference; they're two names for the same thing. GCF (greatest common factor) is the term used in most US school math; GCD (greatest common divisor) is the same concept, more common in computer science and higher math. Both give the same result.
What is a prime factor?
A prime number that divides a given number. A prime number is only divisible by 1 and itself (2, 3, 5, 7, 11 ...). Prime factorization writes a number purely as a product of primes; for example, 60 = 2² × 3 × 5.
What is the relationship between the GCF and the LCM?
For two numbers, GCF × LCM equals the product of the two numbers. For 12 and 18: 6 × 36 = 216 = 12 × 18. This relationship holds only for two numbers; it doesn't apply directly to three or more. The calculator shows this verification for two numbers.
What is the Euclidean algorithm?
A method for finding the GCF of two numbers through repeated division with remainder. Divide the larger number by the smaller one and take the remainder; then replace the divisor with that remainder and repeat until the remainder is zero. The last divisor is the GCF, and it's much faster than prime factorization for large numbers.
How do you find the LCM by listing multiples?
Write out the multiples of each number (the number times 1, 2, 3, ...) until a value appears in every list — that first shared value is the LCM. Multiples of 4 are 4, 8, 12, 16, 20, 24 and multiples of 6 are 6, 12, 18, 24; the smallest number common to both is 12, so LCM(4, 6) = 12. It's intuitive for small numbers, but the prime factorization and division ladder methods scale better for large ones — the calculator's Listing multiples tab shows this method step by step.
What does relatively prime (coprime) mean?
Numbers whose GCF is 1 are relatively prime: they share no common factor besides 1 (e.g. 8 and 15). In that case, the LCM equals the direct product of the numbers. The numbers themselves don't need to be prime.
What are the GCF and LCM used for?
GCF: simplifying fractions (dividing numerator/denominator by the GCF), splitting a group into the largest equal batches. LCM: adding fractions with a common denominator, and finding when repeating events will next coincide (sync/cycle problems).
Can the GCF or LCM be calculated for decimals or fractions?
Not directly — the GCF and LCM are defined only for whole numbers (integers), because "divides evenly" and "is a multiple of" only make sense for integers. There's no single agreed-upon "non-integer LCM": a decimal like 4.5 has infinitely many decimal multiples (4.5, 9, 13.5, ...), so the concept breaks down without extra rules. This calculator only accepts whole numbers between 1 and 1,000,000,000 and ignores decimal input (e.g. typing "4.5" is treated as "45" once the decimal point is stripped, or rejected if it leaves an invalid value) — always re-enter such values as whole numbers.

If your real numbers have decimals, there are two common workarounds: (1) scale them into integers — multiply every number by the same power of 10 (e.g. 2.5 and 1.75 → ×100 → 250 and 175), find the GCF/LCM of the integers, then divide the result back by that same power of 10; or (2) convert to fractions and use the fraction versions of the rules: GCF of fractions = GCF(numerators) / LCM(denominators), and LCM of fractions = LCM(numerators) / GCF(denominators). For everyday use, rounding decimals to the nearest whole number before entering them is usually simplest.

Methodology & sources

ToolPico's GCF & LCM Calculator is a free, independent tool. Results are not estimates — they are exact and algorithmic. The GCF is computed with the Euclidean algorithm (repeated division with remainder); the LCM is found by applying LCM = (a × b) / GCF(a, b) successively across the numbers. The step-by-step solution independently generates the prime factorization, division ladder, listing-multiples, and Euclidean algorithm steps to show that all four approaches reach the same result.

Basis / sources: the fundamental theorem of arithmetic (every integer has a unique prime factorization) · the Euclidean algorithm · the GCF–LCM product relationship. These concepts are evergreen and don't change over time. Last updated: July 19, 2026.
Explore all ToolPico tools →

🔗 Add this tool to your site

Copy the code below into your own site. The tool is free, always up to date, and runs entirely on your page. No sign-up required.

Preview →
⚡ Built with ToolPico · toolpico.com