# LCM and GCF calculator

> The LCM (least common multiple) is the smallest positive number that every number in the list divides evenly. The GCF (greatest common factor, also called GCD) is the largest number that divides every number in the list. For 12 and 18, the prime factors are 2² × 3 and 2 × 3², so the GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36.

Source: https://www.calterix.com/en-us/calculator/lcm-gcf/ · Updated 11/06/2026 · en-US

## How to find the LCM and GCF

The safest method is to break each number into prime factors. The GCF uses only the primes that appear in every number, each with its lowest power. The LCM uses every prime that appears in any number, each with its highest power.

```
GCF = product of the shared primes, lowest powers
LCM = product of all primes, highest powers
For two numbers: LCM × GCF = a × b
```
The shortcut LCM × GCF = a × b works for two numbers only.

LCM and GCF are the engine behind adding fractions (common denominator) and simplifying them. See the [fraction calculator](https://www.calterix.com/en-us/calculator/fraction/), which uses both.

## Worked examples

| Numbers | Prime factors | GCF | LCM |
| --- | --- | --- | --- |
| 12 and 18 | 2² × 3 and 2 × 3² | 6 | 36 |
| 12, 18, and 30 | 2² × 3, 2 × 3², 2 × 3 × 5 | 6 | 180 |
| 8 and 15 | 2³ and 3 × 5 | 1 | 120 |
| 24 and 36 | 2³ × 3 and 2² × 3² | 12 | 72 |
| 7 and 14 | 7 and 2 × 7 | 7 | 14 |

Answers checked by hand.

For 8 and 15, no prime repeats, so the GCF is 1 (the numbers are called relatively prime or coprime) and the LCM is the plain product, 8 × 15 = 120.

## When to use the LCM and GCF

- LCM: when events repeat on cycles. Buses that leave every 12 and 18 minutes depart together every 36 minutes.
- LCM: a common denominator for adding or subtracting fractions.
- GCF: splitting into equal groups with nothing left over. With 12 sophomores and 18 juniors, the most equal teams you can make is 6.
- GCF: simplifying fractions. 18/24 divides by 6 and becomes 3/4.

> The field accepts positive whole numbers up to 1 trillion. Zero, negatives, and decimals are left out because LCM and GCF are defined here for positive whole numbers.

To compare quantities, use the [proportion calculator](https://www.calterix.com/en-us/calculator/proportion/). For general math, the [scientific calculator](https://www.calterix.com/en-us/calculator/scientific/) covers the rest.

## Frequently asked questions

### How do you find the LCM of two numbers?

Break both numbers into primes and multiply every prime with its highest power. For 12 (2² × 3) and 18 (2 × 3²), the LCM is 2² × 3² = 36.

### How do you find the GCF of two numbers?

Break both numbers into primes and multiply only the shared primes, each with its lowest power. For 12 and 18, the GCF is 2 × 3 = 6. The Euclidean algorithm, which uses repeated division, gets the same answer.

### What is the difference between LCM and GCF?

The LCM is the smallest common multiple and is always at least as big as the largest number. The GCF is the largest common factor and is never bigger than the smallest number. For 12 and 18, they are 36 and 6.

### Is GCF the same as GCD?

Yes. GCF (greatest common factor) and GCD (greatest common divisor) are two names for the same number. Some textbooks also say HCF, for highest common factor.

### How do you find the LCM and GCF of three or more numbers?

The method stays the same: factor every number. The GCF uses the primes present in all of them, and the LCM uses all primes. For 12, 18, and 30, the GCF is 6 and the LCM is 180.

### When is the GCF equal to 1?

The GCF is 1 when the numbers share no prime, which makes them relatively prime. That is the case for 8 and 15, and then the LCM is the product of the numbers: 120.
