GCF and LCM Calculator Quick Answer
Built and tested by the Mathvelo team · Last updated: October 2026 · Every worked example here was recomputed with exact arithmetic before publishing.
The greatest common factor (GCF) is the largest number that divides every number in your list. The least common multiple (LCM) is the smallest number every one of them divides into. For 48 and 180 the GCF is 12 and the LCM is 720. GCF, HCF and GCD are three names for the same thing.
How to Use This GCF and LCM Calculator
- Enter your numbers. Type two or more whole numbers separated by commas, such as 48, 180.
- Choose a method. Prime factors, Euclid’s algorithm or listing multiples, whichever your teacher expects.
- Read the working. You get the GCF, the LCM and every line of the method, plus a check.
How to Find the GCF and LCM by Listing
Listing is the method most textbooks teach first. Write the factors of each number, circle the common ones and pick the largest. For 24 and 36 the factors of 24 are 1, 2, 3, 4, 6, 8, 12, 24 and the factors of 36 are 1, 2, 3, 4, 6, 9, 12, 18, 36. The largest shared factor is 12. For the LCM, list multiples instead: 24, 48, 72 and 36, 72, so the first match is 72. It works for small numbers, but listing becomes slow and error-prone beyond about 50, which is when prime factors or Euclid take over.
How to Find the GCF and LCM With Prime Factors
Break each number into primes, then compare. The GCF takes the primes both numbers share, each at its lowest power. The LCM takes every prime that appears, each at its highest power.
48 = 2⁴ × 3 and 180 = 2² × 3² × 5
- Lowest powers: 2² × 3 = 12, so the GCF is 12.
- Highest powers: 2⁴ × 3² × 5 = 720, so the LCM is 720.
- Check: 12 × 720 = 8,640 = 48 × 180.
Answer: GCF 12, LCM 720
Euclid’s Algorithm: The Fast Way for Big Numbers
Euclid described this method around 300 BC in Book VII of the Elements. Divide the larger number by the smaller, then repeat with the divisor and the remainder until the remainder is zero. The last divisor is the GCF. It needs no prime tables, so it beats factoring on large numbers.
Repeat division with remainders
- 1,071 = 2 × 462 + 147.
- 462 = 3 × 147 + 21.
- 147 = 7 × 21 + 0, so the last divisor is 21.
Answer: GCF 21, and LCM = 1,071 × 462 ÷ 21 = 23,562
GCF and LCM of Three or More Numbers
Work through the list one pair at a time, or use the prime-factor rule across all numbers. For 12, 18 and 30 the GCF is 6 and the LCM is 180. Be careful with the shortcut GCF × LCM = product. It is true for two numbers only: 6 × 180 = 1,080, but 12 × 18 × 30 = 6,480.
GCF and LCM With Variables and Fractions
Apply the same rules to each variable. For 12x²y and 18xy³ the GCF is 6xy (lowest powers) and the LCM is 36x²y³ (highest powers). For fractions the LCM of the denominators is the least common denominator: 1/6 + 3/8 uses LCM(6, 8) = 24, so 4/24 + 9/24 = 13/24. The fraction calculator does this automatically.
When to Use the GCF and When to Use the LCM
Ask whether the problem splits things up or lines things up. Splitting into the largest equal pieces with nothing left over is a GCF problem. Repeating events that meet again is an LCM problem.
Prime Factorization and Factor Trees
Every whole number above 1 is a product of primes in exactly one way, which is why prime factors give a reliable GCF and LCM. To build a factor tree, split the number into any two factors, then keep splitting each branch until only primes are left. For 180: 180 = 18 × 10, then 18 = 2 × 9 and 10 = 2 × 5, then 9 = 3 × 3. The leaves read 2, 2, 3, 3, 5, so 180 = 2² × 3² × 5.
Why GCF × LCM Equals the Product for Two Numbers
Each prime appears in the GCF at its lowest power and in the LCM at its highest power, and those two powers together add up to the powers in the two numbers. That is why GCF × LCM = a × b for a pair. With three numbers the lowest and highest powers leave a middle one out, so the identity fails. The calculator’s product-check tab shows both outcomes side by side.
Common GCF and LCM Mistakes
- Swapping the two. The GCF can never be larger than the smallest number, and the LCM can never be smaller than the largest. If your GCF of 24 and 36 comes out as 72, you found the LCM.
- Taking the wrong powers. GCF uses the lowest power of each shared prime; LCM uses the highest power of every prime. Mixing them is the most common slip with exponents.
- Stopping a factor tree early. Keep splitting until every branch ends on a prime. Writing 12 as a leaf instead of 2 × 2 × 3 produces a wrong GCF.
Real-Life Uses: Tiles, Schedules and Gear Teeth
A tiler with a 126 cm by 84 cm sheet wants identical squares with no waste, so the side must divide both: the GCF is 42 cm and the sheet makes 3 × 2 = 6 tiles. A planner with two shifts repeating every 12 and 18 days wants the next shared day off: the LCM is 36 days. Gear designers use the same idea, since two gears with 12 and 18 teeth return to their starting position after 36 teeth have passed. The calculator above handles each case once you decide whether you are splitting or lining things up.
Our Take: What Is Overrated, Underrated and Plain Wrong
Overrated: listing every factor. Prime factorisation or Euclid’s algorithm is faster as numbers grow.
Underrated: Euclid’s algorithm. gcd(1071, 462) = 21 in three divisions.
Plain wrong: GCF × LCM = product of numbers for three or more numbers. It holds for exactly two.
GCF and LCM Practice Problems With Answers
Try each by hand first.
- GCF and LCM of 24 and 36
Answer
12 and 72 - GCF of 84 and 126
Answer
42 - LCM of 4, 6 and 10
Answer
60 - GCF of 1,071 and 462
Answer
21 - GCF and LCM of 12x²y and 18xy³
Answer
6xy and 36x²y³
Written by the Mathvelo team, who do not claim a teaching credential. Every method is shown so you can check it. See About, Contact, Privacy and Terms, or report a mistake.
Why Students Get Stuck on GCF and LCM, and What a Good Calculator Should Do
Searching for help with gcf and lcm usually starts late at night with one problem that will not work out. The two ideas sound alike, and large numbers need a system. A good calculator fixes that by showing each step, checking its own answer and explaining the idea in plain words. This section covers what students struggle with, what they want, and how this page responds.
In short: students need to use prime factorisation to find both reliably, not just see a final number, and a calculator earns trust only when its steps can be checked.
Understand the pain points
What students get stuck on
Most mistakes here are not about arithmetic. They come from one rule applied the wrong way round, which is why seeing every step matters.
- Mixing up which one is greatest and which is leastGCF of 24 and 36↗
- Missing a prime factor in the listLCM of 12 and 18↗
- Using the wrong power of a primeGCF of 48, 60 and 72↗
- Not knowing which one a word problem needsLCM of 4, 6 and 10↗
Understand the frustrations and desires
What they feel, and what they want
Each frustration points to a wish: a clearer step, a built-in check, an explanation in plain words.
- Wants the prime factor tree shown
- Wants both GCF and LCM from one input
- Wants a check with the product rule
Build the page around their intent
Each intent has a place on this page
The page follows intent, not features, so each need has a clear starting point.
- I need an answer now: type the problem into the calculator at the top of this page.GCF of 24 and 36↗
- I need to understand: the sections below explain the idea in plain words and list the common mistakes.
- I need to check my work: every step is shown, so the first line that differs from yours is the one to study.
- I need practice: open the solver, tap + and choose Create Practice Test.
- I need it explained aloud: in the solver, tap + and choose Create Video.