Two answers in one click: GCF and LCM with the work shown
Some math jobs are just errands, and finding the greatest common factor of two numbers is one of them. It matters — simplifying fractions, adding fractions, factoring, half of sixth-grade math — yet doing it by hand with anything past two digits turns into a slog of factor trees and mental multiplication. This GCF and LCM calculator handles the whole errand at once: type your numbers, get both answers instantly, and see the prime factorization and Euclid's algorithm work that produced them.
Why compute both together? Because GCF and LCM are two sides of one coin, stitched together by a neat identity: for any two numbers, GCF × LCM equals the product of the numbers themselves. Once you know one answer, the other is a division away. A tool that gives you only half of that pair is quietly doing half your homework's checking for you.
The calculator runs entirely in your browser. No signup, no upload, no waiting — results recompute as you type, the steps update with them, and nothing you enter ever leaves your device. That last part matters if you're a teacher generating answer keys or a student double-checking work at 10 p.m.
Below, you'll find the two solution methods written out the way a textbook would, three fully verified worked examples, the edge cases that trip people up, and an honest account of what this tool will not do for you. Skim the headings if you're in a hurry; read the method sections if the quiz is tomorrow. Either way, the numbers on this page have been checked by hand before they were checked by code.
What the GCF and LCM actually measure
The greatest common factor (GCF) of two numbers is the largest whole number that divides both of them with no remainder. It answers the question: how big can the shared pieces be? If you have a 36-inch board and a 60-inch board and want equal-length pieces with no offcuts, the GCF of 12 inches is your answer — three pieces from one board, five from the other.
Run the same question in reverse and you get the least common multiple (LCM). It is the smallest whole number that both of your numbers divide into evenly. It answers: when do the cycles line up? A bus that comes every 36 minutes and one that comes every 60 minutes will pull into the same stop together for the first time after 180 minutes. GCF compresses, LCM expands.
- GCF of 12 and 30 is 6 — the largest number dividing both exactly.
- LCM of 4 and 6 is 12 — the smallest number both divide into exactly.
- The GCF can never exceed the smaller input; the LCM can never be smaller than the larger input.
- Coprime numbers (GCF = 1) multiply to give their LCM: for 8 and 15, LCM = 120.
- If one number divides the other, the GCF is the smaller number and the LCM is the larger one: GCF(12, 60) = 12, LCM(12, 60) = 60.
A naming note before it trips you up: American classrooms say GCF, mathematicians and programmers write GCD (greatest common divisor), and British textbooks call it HCF (highest common factor). Three labels, one number. The tool here uses the American term because that is what most people search for.
How to use the GCF and LCM Calculator
The workflow takes about ten seconds to learn and about two seconds to use after that. The tool sits at the top of this page, so you can follow along while reading.
Enter your numbers
Type two or more positive integers, separated by commas or spaces. For a classic two-number problem like 36 and 60, just type those.
Choose what you need
Pick GCF, LCM, or both. Both is the default because the identity check that comes with it is free verification you would otherwise do by hand.
Read the live result
Answers recompute on every keystroke, so a typo shows up immediately as an implausible number rather than hiding until the end of your homework session.
Open the steps panel
Each number's prime factorization is written out, followed by the lowest-power and highest-power combinations that produce the GCF and LCM.
Check the identity line
For two inputs the tool shows GCF × LCM next to A × B. If those match, as they always should, your answer carries a built-in proof of correctness.
Copy what you need
One click copies the final answers or the full worked steps, formatted for pasting into notes, lesson plans, or a student's take-home sheet.
Method one: prime factorization, the way textbooks teach it
Every whole number greater than 1 factors into primes in exactly one way — mathematicians call this the Fundamental Theorem of Arithmetic, and it is the reason this method works at all. Break each input into primes, then combine those primes deliberately: shared primes at their lowest power build the GCF, all primes at their highest power build the LCM.
Take 36 and 60. Factor them and you get 36 = 2² × 3² and 60 = 2² × 3 × 5. Both numbers carry 2 twice, so the GCF takes 2². One number carries 3 twice and the other once, so the GCF takes the smaller count, 3¹. The 5 appears in only one number, so it contributes nothing to the GCF: 2² × 3 = 12. The LCM is the opposite game — take the maximum of every column, 2² × 3² × 5 = 180.
| Prime | 36 | 60 | GCF takes (min) | LCM takes (max) |
|---|---|---|---|---|
| 2 | 2² | 2² | 2² | 2² |
| 3 | 3² | 3¹ | 3¹ | 3² |
| 5 | — | 5¹ | — | 5¹ |
| Product | 36 | 60 | 2² × 3 = 12 | 2² × 3² × 5 = 180 |
Verify both results against the originals: 36 ÷ 12 = 3 and 60 ÷ 12 = 5, both exact, so 12 divides both. And 180 ÷ 36 = 5 while 180 ÷ 60 = 3, again exact, so both numbers divide 180. Six seconds of division arithmetic confirms the entire table — do this whenever a factor tree feels wobbly.
Method two: Euclid's algorithm, the 2,300-year-old shortcut
Prime factorization is transparent but slow for big numbers. Euclid's algorithm, written down around 300 BC in Book VII of the Elements, gets there with nothing but division — and it is one of the oldest algorithms still in everyday use, quietly running inside cryptography software whenever two keys need a common-divisor check.
Divide the larger by the smaller
For 48 and 180: 180 ÷ 48 = 3 with remainder 36. Write it as 180 = 3 × 48 + 36.
Replace the pair with divisor and remainder
Now divide 48 by 36: that gives 1 with remainder 12, or 48 = 1 × 36 + 12.
Repeat until the remainder hits zero
Divide 36 by 12: exactly 3, remainder 0. The chain has terminated.
Read off the last nonzero remainder
The final remainder before zero — 12 here — is the GCF of the original pair. No factor tree, no primality testing, four divisions total.
Why does this work? Because any number that divides both A and B must also divide the remainder when A is divided by B, and it must keep dividing every remainder down the chain. The divisors can only shrink, and they stop shrinking exactly at the GCF. The classic textbook example is GCF(1071, 462): 1071 = 2 × 462 + 147, then 462 = 3 × 147 + 21, then 147 = 7 × 21 + 0 — GCF is 21, found in three divisions.
Once Euclid hands you the GCF, the LCM costs one division: LCM = A × B ÷ GCF. For 48 and 180, that is 8640 ÷ 12 = 720. This is precisely the identity at work, which makes the calculator's cross-check line more than decoration — it is the algorithm's own proof of correctness rendered in one line.
The GCF × LCM identity, and why it only works for two numbers
For exactly two numbers, GCF(A, B) × LCM(A, B) = A × B. Always. With 36 and 60: 12 × 180 = 2160 and 36 × 60 = 2160. With 48 and 180: 12 × 720 = 8640 and 48 × 180 = 8640. The reason sits in the exponent table above — for each prime, the minimum power and the maximum power together sum to the total power across both numbers, so multiplying the GCF by the LCM reconstructs the full product, prime by prime.
Here is the trap, and it catches good students regularly: add a third number and the identity breaks. Take 4, 6, and 15. The GCF is 1 and the LCM is 60, but 4 × 6 × 15 = 360, not 60. With three numbers, a prime can appear strongly in one input and weakly in two others, and the min-plus-max bookkeeping no longer balances. The calculator never applies the shortcut to three or more inputs — it computes the LCM directly — and neither should you.
Worked examples with verified numbers
Every number below was computed and re-checked by hand. Run these through the calculator yourself — matching the outputs here confirms the tool is behaving before you trust it with your own problem set.
Input
36 and 60
Output
GCF = 12 · LCM = 180 · 36 = 2² × 3², 60 = 2² × 3 × 5 → GCF = 2² × 3, LCM = 2² × 3² × 5
The shared primes are 2² and 3, which builds the GCF of 12. The leftover 5 belongs to 60 alone, so it rides along into the LCM only, pushing it to 180. Sanity check the identity: 12 × 180 = 2160, which equals 36 × 60 exactly. Both answers are provably right before you copy them anywhere.
Input
48 and 180
Output
GCF = 12 · LCM = 720 · Euclid: 180 = 3 × 48 + 36 → 48 = 1 × 36 + 12 → 36 = 3 × 12 + 0
This pair shows the algorithm path: four divisions produce a GCF of 12 with no factorization at all, then 48 × 180 ÷ 12 = 720. The identity check reads 12 × 720 = 8640 = 48 × 180. If you ever get an LCM smaller than 180 for these inputs — a common slip — the check fails loudly and you know to look again.
Input
4, 6, and 15
Output
LCM = 60 · 4 = 2², 6 = 2 × 3, 15 = 3 × 5 → LCM = 2² × 3 × 5 = 60
Three numbers, handled two ways. Pairwise: LCM(4, 6) = 12, then LCM(12, 15) = 60. Direct: take the highest power of each prime that appears anywhere — 2² from the 4, 3 from either, 5 from the 15. Both roads land on 60, and the divisibility test seals it: 60 ÷ 4 = 15, 60 ÷ 6 = 10, 60 ÷ 15 = 4, all exact.
Edge cases and common mistakes
After enough graded worksheets, the same handful of errors account for nearly every wrong GCF or LCM. Each one below has a specific fix.
- Applying the two-number identity to three numbers. GCF(4, 6, 15) = 1 and LCM = 60, but the product is 360 — the shortcut is strictly a pair tool.
- Swapping the min/max rules. Taking the highest powers for a GCF would hand you the LCM instead; for 36 and 60 that mistake yields 180 labeled as a common factor, which is absurd on its face since 180 exceeds both inputs.
- Forgetting the divisibility case. When the smaller number divides the larger, the GCF is the smaller number itself — students often expect something deeper. GCF(12, 60) = 12, no tree required.
- Assuming coprime means no relationship. Coprime numbers have GCF 1 and their product as the LCM: 8 × 15 = 120, both verified in one line.
- Transposing digits while typing. 36 and 63 are one keystroke apart but give entirely different answers — the live-recompute design surfaces this instantly as a surprising result.
- Feeding in zero. By convention GCF(a, 0) = a and LCM(a, 0) = 0, but zero rarely belongs in the problem you actually meant to type; double-check the entry.
One habit worth building: before copying any GCF or LCM answer, spend ten seconds on the boundary checks. Is the GCF at most the smaller number? Does each input divide the LCM exactly? Both checks are single divisions, they fit in your head, and together they catch nearly every error on this list — including the ones calculators make when fingers slip.
Who actually uses this: real scenarios
The abstract version of these two ideas hides how often they show up with sleeves rolled up. Concrete cases are easier to remember than definitions.
- Sixth-grade students — US Common Core standard 6.NS.B.4 explicitly requires finding GCF and LCM up to 100 and using them to simplify fractions, so this tool lines up with the exact year the topic lands.
- Teachers writing answer keys — generating GCF/LCM sets for quizzes means solving dozens of pairs; the steps panel turns each into ready-made worked solutions.
- Anyone simplifying fractions — 36/60 collapses to 3/5 after one look at the GCF of 12, and 48/180 becomes 4/15 the same way.
- Fraction arithmetic — adding 1/36 + 1/60 wants the LCM of 180 as the common denominator: 5/180 + 3/180 = 8/180, which reduces to 2/45.
- Scheduling problems — two delivery trucks cycling every 36 and 60 minutes overlap first at the 180-minute mark; planners call this the beat interval.
- Woodworkers and fabricators — cutting 36-inch and 60-inch stock into equal 12-inch pieces with zero waste is literally a GCF problem with sawdust.
- Programmers — the GCD routine inside this tool's logic is the same one libraries use for reducing ratios in graphics code and checking key compatibility in RSA cryptography.
Tool versus by hand versus spreadsheets
You have at least four ways to answer a GCF/LCM question. They are not equally fast, equally transparent, or equally instructive, and the right choice depends on whether you need the number, the method, or both.
| Method | Speed on big numbers | Shows steps | Three or more inputs | Error risk |
|---|---|---|---|---|
| This GCF and LCM calculator | Instant | Yes — factorization and Euclid side by side | Yes, directly computed | Very low — identity check included |
| Factor trees by hand | Minutes, grows quickly | You write every branch yourself | Tedious but possible | Medium — one missed prime cascades |
| Euclid's algorithm by hand | Fast once practiced | Only the division chain | Fold pairs in order | Low with careful arithmetic |
| Excel =GCD() / =LCM() | Instant | No — black-box result | Yes, up to 255 arguments | Low, but the method stays hidden |
Spreadsheets deserve their column: Excel ships both GCD and LCM functions and they are accurate. What they never show is the work, which makes them fine for checking and poor for learning. The point of this calculator's steps panel is that a correct answer and a teachable method arrive in the same click.
Honest limits: where to slow down
The arithmetic here is exact integer math, not an approximation, so there is no precision to distrust — but scope still matters. The tool takes positive integers; it will not factor your algebra homework, distribute variables, or interpret a word problem. Reading a bus-schedule question and deciding it wants an LCM remains a human job, and that interpretation step is where most real mistakes live.
A pedagogical limit deserves honesty too. If you are learning this material, the steps exist to be read, not skipped. A student who only copies the two bold answers learns nothing that transfers to a exam desk with a pencil. The productive pattern is: attempt the pair by hand, run the calculator, compare, and investigate any difference — that is where the actual learning happens, and it takes two extra minutes.
Frequently asked questions
These are the questions people actually type into search bars about GCF and LCM, answered directly. If yours is missing, the contact page takes question requests.
What is the difference between GCF and LCM?
The GCF is the largest number that divides both inputs evenly; the LCM is the smallest number that both inputs divide into. For 36 and 60, the GCF is 12 and the LCM is 180. One shrinks things down to shared pieces, the other lines cycles up.
How do I find the GCF of large numbers quickly?
Use Euclid's algorithm: divide the larger number by the smaller, then repeat with the divisor and the remainder until the remainder is zero. The last nonzero remainder is the GCF. For 1071 and 462 it takes just three divisions to land on 21.
What is the LCM of 3 numbers?
Fold the numbers pairwise, or take the highest power of every prime that appears. For 4, 6, and 15: LCM(4, 6) = 12, then LCM(12, 15) = 60. Check it — 60 ÷ 4 = 15, 60 ÷ 6 = 10, 60 ÷ 15 = 4, all exact.
Are GCF, GCD, and HCF the same thing?
Yes. American textbooks say greatest common factor (GCF), mathematicians and programmers say greatest common divisor (GCD), and British schools say highest common factor (HCF). All three names describe exactly the same number.
Why does GCF × LCM equal the product of the two numbers?
For each prime, the GCF takes the smaller exponent and the LCM takes the larger. Those two exponents sum to the total across both numbers, so the products match: 12 × 180 = 2160 = 36 × 60. This identity holds for exactly two numbers, not three or more.
How is the LCM used to add fractions?
The LCM of the denominators is the least common denominator. For 1/36 + 1/60, the LCM is 180, so rewrite as 5/180 + 3/180 = 8/180, which simplifies to 2/45. Same method works for any pair of fractions.
Can the GCF be bigger than one of the numbers?
Never. The GCF is at most the smaller of the two inputs, and it equals that smaller number exactly when the smaller divides the larger — for example, GCF(12, 60) = 12, with an LCM of 60.
Does the calculator work with decimals or negative numbers?
The tool is built for positive integers, which is where GCF and LCM are defined. Decimals should be converted to whole-number fractions first; for negative integers, the GCF is conventionally taken on absolute values. Enter whole numbers and both answers are exact.
Sources and further reading
The method on this page is standard number theory, and these references back the specifics.
Sources and further reading
- Euclid's Elements, Book VII (D. Joyce's edition) — https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/bookVII.html (the original propositions behind the division algorithm for greatest common measure)
- Common Core State Standards for Mathematics, 6.NS.B.4 — http://www.corestandards.org/Math/Content/6/NS/B/4/ (the US grade-6 standard requiring GCF and LCM up to 100)
- Wolfram MathWorld, Greatest Common Divisor — https://mathworld.wolfram.com/GreatestCommonDivisor.html (formal definition and the two-number product identity)
- Wolfram MathWorld, Least Common Multiple — https://mathworld.wolfram.com/LeastCommonMultiple.html (LCM definition and pairwise computation for multiple inputs)
- LibreTexts Mathematics — https://math.libretexts.org/ (prime factorization method as taught in introductory algebra courses)
We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.