The GCF and LCM calculator finds the greatest common factor and the least common multiple of 2 to 10 whole numbers, with every step shown. It writes each number as a product of primes, draws a factor tree and a Venn diagram, checks the GCF with the Euclidean algorithm, and lists the factors and multiples for small numbers. A second tab finds the least common denominator (LCD) of fractions.
GCF is the greatest common factor (also called GCD or HCF). LCM is the least common multiple. The LCD of fractions is the LCM of their denominators.
In short: GCF = the primes every number shares, multiplied together (lowest powers). LCM = every prime that appears, multiplied together (highest powers). For 12 and 18: GCF = 6 and LCM = 36.
How to Use the GCF and LCM Calculator
- Type your numbers separated by commas or spaces, such as
24, 36or8 12 16. You can enter up to 10 whole numbers. - Press Calculate. You get the GCF and the LCM together, plus a Venn diagram (for two numbers) and a factor tree for each number.
- Read the steps. They show the prime factorization, the shared primes, the Euclidean check and, for two numbers, that GCF × LCM equals the two numbers multiplied.
- For fractions, open the LCD of fractions tab and type fractions such as
1/4, 5/6, 3/8. The calculator finds the least common denominator and rewrites each fraction with it.
What Are the GCF, LCM and LCD?
| Term | Meaning | Example (12 and 18) |
|---|---|---|
| GCF (greatest common factor, also GCD or HCF) | The largest number that divides into every number exactly | 6 |
| LCM (least common multiple) | The smallest number that every number divides into exactly | 36 |
| LCD (least common denominator) | The LCM of the denominators of some fractions | 1/12 and 1/18 → LCD 36 |
Two quick checks: the GCF can never be bigger than the smallest number, and the LCM can never be smaller than the largest number. For any two numbers, GCF × LCM = the two numbers multiplied: 6 × 36 = 216 = 12 × 18.

Worked Examples
| Numbers | Prime factors | GCF | LCM |
|---|---|---|---|
| 12, 18 | 2² × 3 and 2 × 3² | 6 | 36 |
| 24, 36 | 2³ × 3 and 2² × 3² | 12 | 72 |
| 8, 12, 16 | 2³, 2² × 3 and 2⁴ | 4 | 48 |
| 15, 20, 25 | 3 × 5, 2² × 5 and 5² | 5 | 300 |
| 84, 126 | 2² × 3 × 7 and 2 × 3² × 7 | 42 | 252 |
| 7, 13 | both prime | 1 | 91 |
Example: LCD of 1/4, 5/6 and 3/8. The LCM of 4, 6 and 8 is 24, so the LCD is 24: 1/4 = 6/24, 5/6 = 20/24 and 3/8 = 9/24. This is the first step when you add fractions with different denominators.
Learn the Methods
- How to find the GCF: listing factors, prime factorization, the ladder method and the Euclidean algorithm.
- How to find the LCM: listing multiples, prime factorization and the GCF shortcut.
- GCF vs LCM: how to tell which one a word problem needs, with solved examples.
- How to simplify fractions: the GCF in action.
GCF and LCM Calculator: FAQ
What is the GCF of 12 and 18?
The GCF of 12 and 18 is 6. 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3, and the shared primes 2 × 3 make 6.
What is the LCM of 12 and 18?
The LCM of 12 and 18 is 36. Multiply every prime at its highest power: 2² × 3² = 36.
Is GCF the same as GCD and HCF?
Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the same number.
Can the calculator find the GCF and LCM of three or more numbers?
Yes. Enter up to 10 numbers. For 8, 12 and 16 it gives GCF 4 and LCM 48.
How do I find the least common denominator?
The least common denominator is the LCM of the denominators. For 1/4 and 5/6, the LCM of 4 and 6 is 12, so the LCD is 12.
What does it mean if the GCF is 1?
The numbers are relatively prime (coprime): they share no factor except 1. Their LCM is then their product, such as 7 × 13 = 91.
Is the GCF and LCM calculator free?
Yes. It is free, needs no sign-up and runs in your browser.
Sources and Further Reading
- OpenStax, Prealgebra, Section 2.5: Prime Factorization and the Least Common Multiple, Rice University.
- OpenStax, Prealgebra 2e, Section 10.6: Introduction to Factoring Polynomials (finding the greatest common factor).
- Common Core Grade 6: The Number System (6.NS.B.4: greatest common factor and least common multiple).
Also try the fraction calculator, the equivalent fractions calculator and the scientific calculator.