3tej home
← Math

What is GCF + LCM Calculator?

A GCF + LCM Calculator computes gcf + lcm from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. Free GCF + LCM Calculator.

Interactive calculator

GCF and LCM calculator

Greatest common factor and least common multiple.

GCF-
LCM-
Numbers parsed-

GCF + LCM Calculator

GCF: largest number dividing all. LCM: smallest multiple of all.

About GCF and LCM

The greatest common factor (GCF) of a set of whole numbers is the largest number that divides all of them with no remainder. The least common multiple (LCM) is the smallest positive number that every one of them divides into. They are two of the most useful ideas in elementary number theory: the GCF answers "how large a shared piece can I break these into?" and the LCM answers "when do these cycles line up?". This calculator takes a comma-separated list and returns both, along with their product, for two or more values.

GCF is also called the greatest common divisor (GCD), the term used in mathematics and computing, while GCF is the label taught in school. For exactly two numbers the two quantities are tied together by a clean identity: the GCF multiplied by the LCM equals the product of the two numbers. That relationship is what lets the calculator compute the LCM cheaply once it has the GCF.

How it works

The tool finds the GCF with the Euclidean algorithm, one of the oldest algorithms still in use, then derives the LCM from it:

GCF(a, b): repeat  a, b = b, a mod b  until b = 0; GCF is a
LCM(a, b) = |a x b| / GCF(a, b)
For two numbers:  GCF x LCM = a x b
Many numbers:  fold pairwise, e.g. GCF(a,b,c) = GCF(GCF(a,b), c)
  • Euclid is fast: it uses repeated division instead of listing every factor, so it handles large numbers instantly.
  • LCM from GCF: once the GCF is known, the LCM is just the product divided by it, avoiding a separate search.
  • Coprime check: if the GCF is 1, the numbers share no common factor and are called coprime (relatively prime).

Worked example

Find the GCF and LCM of 12 and 18.

  1. Euclidean steps: 18 mod 12 = 6, then 12 mod 6 = 0, so GCF = 6.
  2. Product: 12 x 18 = 216.
  3. LCM: 216 / 6 = 36.
  4. Check the identity: GCF x LCM = 6 x 36 = 216 = 12 x 18. It holds.
  5. Use it: the GCF of 6 simplifies 12/18 to 2/3; the LCM of 36 is the common denominator for adding twelfths and eighteenths.
Result: GCF(12, 18) = 6 and LCM(12, 18) = 36. Because the two numbers share the factor 6 they are not coprime, and their product 216 splits exactly into the GCF and LCM.

GCF and LCM reference

NumbersGCFLCMNote
8 and 12424Share factor 4
9 and 281252Coprime, LCM = product
6, 8 and 102120Three numbers, pairwise
15 and 25575Share factor 5
7 and 21721One divides the other

Using GCF and LCM with fractions

The two operations show up together whenever you work with fractions. To reduce a fraction to lowest terms, divide the numerator and denominator by their GCF: 18/24 has a GCF of 6, so it simplifies to 3/4. To add or subtract fractions, you first need a common denominator, and the smallest one to use is the LCM of the denominators. Adding 1/6 and 1/8, the LCM of 6 and 8 is 24, so the sum becomes 4/24 + 3/24 = 7/24.

Cycle problems are the other classic use. If one bus comes every 6 minutes and another every 8 minutes, they next arrive together after LCM(6, 8) = 24 minutes. If you want to cut two ribbons of 12 cm and 18 cm into equal pieces with none left over, the longest each piece can be is GCF(12, 18) = 6 cm. Recognising which question you are asking, a shared piece (GCF) or a shared cycle (LCM), tells you which output to read.

Common pitfalls

  • Swapping the two. The GCF is never larger than the smallest input; the LCM is never smaller than the largest. If your answer breaks that, you have them reversed.
  • Assuming LCM equals the product. That is only true when the numbers are coprime (GCF = 1). When they share a factor, the LCM is smaller than the product.
  • Forgetting the GCF x LCM identity is for two numbers. It does not extend directly to three or more; fold pairwise instead.
  • Mishandling negatives and zero. The GCF is taken on absolute values and the LCM is always positive; the LCM with zero is undefined.
  • Listing factors for big numbers. Brute-force factor listing is slow and error-prone; the Euclidean algorithm is the reliable method.

Related tools

Frequently asked questions

What is the difference between GCF and LCM?

The greatest common factor (GCF) is the largest number that divides evenly into all your values; the least common multiple (LCM) is the smallest number that all your values divide into. GCF is always less than or equal to the smallest input, and LCM is always greater than or equal to the largest input. For two numbers they are linked by GCF x LCM = a x b.

Is GCF the same as GCD?

Yes. GCF (greatest common factor) and GCD (greatest common divisor) are two names for the same quantity. GCD is the term used in number theory and computer science; GCF is the term taught in most K-12 classrooms. Both refer to the largest integer that divides all the given numbers without a remainder.

How does the Euclidean algorithm find the GCF?

It repeatedly replaces the larger number with the remainder of dividing the larger by the smaller, until the remainder is zero; the last non-zero value is the GCF. For example GCF(48, 18): 48 mod 18 = 12, then 18 mod 12 = 6, then 12 mod 6 = 0, so the GCF is 6. It is far faster than listing factors for large numbers.

How do I find the GCF or LCM of three or more numbers?

Work in pairs. For the GCF, compute GCF(a, b), then take the GCF of that result with c, and so on: GCF(a, b, c) = GCF(GCF(a, b), c). The LCM works the same way: LCM(a, b, c) = LCM(LCM(a, b), c). This calculator accepts a comma-separated list and applies the pairwise rule automatically.

Where are GCF and LCM actually used?

The GCF simplifies fractions to lowest terms (12/18 divides by GCF 6 to give 2/3). The LCM finds a common denominator for adding fractions and solves cycle-alignment problems, such as when two events that repeat every 6 and 8 days next coincide (LCM 24 days). Both appear in scheduling, gear ratios, music rhythm, and cryptography.