The quick answer

GCF and LCM of two positive integers, with every step shown. The page opens with 36 and 60 already loaded, and the answers arrive with it: GCF 12, LCM 180. Euclid's remainder chain does the work; for 48 and 18 it reads 48 = 2×18 + 12, 18 = 1×12 + 6, 12 = 2×6 + 0, so the GCF is 6 and the LCM is 48×18÷6 = 144. Prime factorization and the GCF × LCM identity check come with it.

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. This 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. The GCF matters for simplifying fractions, adding fractions and factoring, yet doing it by hand with anything past two digits turns into a slog of factor trees and mental multiplication.

GCF and LCM are computed together because they 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, 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 late at night.

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 measures how big the shared pieces can 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 and 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 measures when 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.

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 tool is two input boxes and an instant answer. The page opens with 36 and 60 already loaded; type over them with your own pair and the GCF and LCM cards, the Euclid chain and both prime factorizations recompute on every keystroke. The two answers arrive together because they are two views of the same arithmetic.

  1. Enter your two numbers

    Type a positive integer into each box, First number and Second number. The page loads with 36 and 60, a classic homework pair, already in place.

  2. Read both answer cards

    The GCF and LCM cards fill in together; there is nothing to pick, because the pair arrives as a package with the verification line attached.

  3. Watch 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.

  4. Read the steps panel

    Euclid's algorithm runs as a chain of division identities, each number's prime factorization is written out, and the lowest-power and highest-power combinations that build the GCF and LCM are shown beside them. One quirk to expect: when the first number is smaller than the second, the chain opens with a zero-quotient line (36 = 60 × 0 + 36) before the real divisions begin.

  5. 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.

  6. Keep what you need

    The Euclid chain, both prime factorizations and the verification line all stay on screen while you type; screenshot or transcribe whatever your notes, lesson plan or answer key needs.

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, taking the maximum of every column: 2² × 3² × 5 = 180.

Prime3660GCF takes (min)LCM takes (max)
22²2²2²2²
33²3¹3¹3²
505¹05¹
Product36602² × 3 = 122² × 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.

  1. Divide the larger by the smaller

    For 48 and 180: 180 ÷ 48 = 3 with remainder 36. Write it as 180 = 3 × 48 + 36.

  2. Replace the pair with divisor and remainder

    Now divide 48 by 36: that gives 1 with remainder 12, or 48 = 1 × 36 + 12.

  3. Repeat until the remainder hits zero

    Divide 36 by 12: exactly 3, remainder 0. The chain has terminated.

  4. 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.

This works 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, and the 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. This calculator takes exactly two numbers, so the shortcut never meets a three-number case; for three or more, compute each answer from the prime factorizations instead.

Worked examples with verified numbers

Every number below was computed and re-checked against the calculator's own engine, the same code path your keystrokes take. Run these through the tool yourself; matching the outputs here confirms it is behaving before you trust it with your own problem set.

GCF and LCM of 36 and 60 (the page's default pair)

Input

36 and 60

Output

GCF = 12 · LCM = 180 · Euclid chain as the tool prints it: 36 = 60 × 0 + 36 → 60 = 36 × 1 + 24 → 36 = 24 × 1 + 12 → 24 = 12 × 2 + 0 · Check: GCF × LCM = 12 × 180 = 2160; A × B = 36 × 60 = 2160 ✓

The chain opens with that zero-quotient line because the first number, 36, is smaller than the second, 60; the engine divides in the order you type. The shared primes are 2² and 3, which build the GCF of 12. The leftover 5 belongs to 60 alone, so it rides into the LCM only, pushing it to 180. Both answers are provably right before you copy them anywhere.

GCF and LCM of 48 and 180 via Euclid

Input

48 and 180

Output

GCF = 12 · LCM = 720 · Euclid: 180 = 3 × 48 + 36 → 48 = 1 × 36 + 12 → 36 = 3 × 12 + 0 · Check: GCF × LCM = 12 × 720 = 8640; A × B = 48 × 180 = 8640 ✓

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.

LCM of 4, 6, and 15

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, and 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 (GCF 9, LCM 252); the live-recompute design surfaces this instantly as a surprising result.
  • Feeding in zero. Mathematically GCF(a, 0) = a and LCM(a, 0) = 0 by convention, but the calculator refuses zero entirely: typing 0 in either box leaves the answer cards empty. Double-check the entry.

Before copying any GCF or LCM answer, spend ten seconds on the boundary checks: is the GCF at most the smaller number, and 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.

Who actually uses this: real scenarios

Six groups run this arithmetic every week: students checking homework, teachers building answer keys, and four more whose afternoons are quietly made of common factors and common multiples.

  • Middle-school students: finding common factors and common multiples is staple homework in grades 6-8, and the steps panel makes checking that work fast without hiding the method.
  • Teachers writing answer keys: generating GCF/LCM sets for quizzes means solving dozens of pairs, and the steps panel turns each into a ready-made worked solution.
  • 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, which planners call the beat interval.
  • 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.

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 two 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 bold answers learns nothing that transfers to a penciled exam. 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 costs 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. The 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 integers, which is where GCF and LCM are defined. A decimal entry is truncated to its integer part (36.7 is read as 36), and for negative integers the answers come out on absolute values. Enter whole numbers and both answers are exact.

Where the answers go next

A GCF or LCM is rarely the end of a problem; it is the input to the next step. Three tools on this site catch that output most often: reducing a fraction you just found the common factor for, scaling a ratio, and converting the finished fraction to a decimal.

  • Simplify Fractions Calculator: paste the GCF work you just did and reduce fractions like 36/60 to 3/5 with the division shown.
  • Ratio Calculator: simplify and scale ratios using the same common-divisor logic this tool applies.
  • Fraction to Decimal: convert your finished fractions to decimal form once the reducing is complete.

Sources and further reading

The method on this page is standard number theory, and these references back the specifics.