GCF & LCM Calculator

Find the GCF and LCM of 2 or more numbers using prime factorization. Step-by-step working with a factor comparison table.

Ad
Ad

About GCF & LCM Calculator

Find the Greatest Common Factor (GCF) and Least Common Multiple (LCM) of two or more numbers using prime factorisation. Enter up to 10 numbers and see the full factor breakdown with a comparison table showing which primes appear in each number.

What Are GCF and LCM?

GCF (Greatest Common Factor)LCM (Least Common Multiple)
DefinitionThe largest number that divides evenly into all given numbersThe smallest number that all given numbers divide into evenly
Also calledGCD (Greatest Common Divisor), HCF (Highest Common Factor)LCD (Least Common Denominator) when used with fractions
Example with 12 and 18GCF = 6LCM = 36
Main useSimplifying fractionsAdding fractions with different denominators

How the Prime Factorisation Method Works

The most reliable way to find GCF and LCM is through prime factorisation:

  1. Break each number into its prime factors
  2. For GCF: take the lowest power of each prime that appears in ALL numbers
  3. For LCM: take the highest power of each prime that appears in ANY number

Worked example: Find GCF and LCM of 48 and 180

Step48180
Prime factorisation2⁴ × 32² × 3² × 5
GCF (min powers of shared primes)2² × 3¹ = 4 × 3 = 12
LCM (max powers of all primes)2⁴ × 3² × 5 = 16 × 9 × 5 = 720

Check: GCF × LCM = 12 × 720 = 8,640 = 48 × 180. This relationship always holds for two numbers.

The GCF-LCM Product Rule

For any two positive integers a and b:

GCF(a, b) × LCM(a, b) = a × b

This means if you know one, you can find the other: LCM(a, b) = (a × b) / GCF(a, b). This shortcut is faster than full prime factorisation for two numbers.

Example: Find LCM(15, 20)

  1. GCF(15, 20) = 5 (by inspection or Euclidean algorithm)
  2. LCM = (15 × 20) / 5 = 300 / 5 = 60

Note: this product rule does not extend directly to three or more numbers. For three numbers, you need to compute pairwise: LCM(a, b, c) = LCM(LCM(a, b), c).

Common GCF and LCM Values

NumbersGCFLCM
6, 8224
12, 18636
15, 25575
24, 361272
14, 21742
30, 451590
8, 12, 18272
6, 10, 15130

The Euclidean Algorithm

For finding the GCF of two numbers without prime factorisation, the Euclidean algorithm is extremely efficient. It works by repeated division:

Worked example: GCF(252, 105)

  1. 252 ÷ 105 = 2 remainder 42
  2. 105 ÷ 42 = 2 remainder 21
  3. 42 ÷ 21 = 2 remainder 0
  4. The last non-zero remainder is the GCF: 21

This algorithm dates back to Euclid's Elements (around 300 BC) and is one of the oldest algorithms still in practical use today. For a deeper look at breaking numbers into primes, see the prime factorisation tool.

When Do You Need GCF and LCM?

TaskWhich to UseExample
Simplify a fractionGCF24/36 - divide both by GCF(24,36) = 12 to get 2/3
Add fractionsLCM1/4 + 1/6 - LCD = LCM(4,6) = 12, so 3/12 + 2/12 = 5/12
Divide items into equal groupsGCF18 red and 24 blue marbles into identical bags - GCF = 6, so 6 bags
Scheduling problemsLCMBus A every 12 min, Bus B every 15 min - both arrive together every LCM = 60 min
Tiling a floor evenlyGCFRoom 96 × 72 cm with square tiles - largest tile = GCF = 24 cm
Gear ratiosLCMGears with 12 and 18 teeth mesh perfectly every LCM = 36 teeth of rotation

GCF of 1 (Coprime Numbers)

When the GCF of two numbers is 1, they are called coprime (or relatively prime). This does not mean both numbers are prime - just that they share no common factor other than 1.

Examples of coprime pairs: (8, 15), (9, 25), (14, 33), (16, 27)

For coprime numbers, the LCM is simply the product: LCM(8, 15) = 8 × 15 = 120.

For fraction arithmetic that uses GCF and LCM automatically, the fraction calculator simplifies and computes with fractions. For dividing numbers and seeing remainders, the long division calculator shows each step.

All calculations run in your browser. No data is sent to any server.

Frequently Asked Questions

What is the difference between GCF and LCM?

GCF (Greatest Common Factor) is the largest number that divides evenly into all given numbers. LCM (Least Common Multiple) is the smallest number that all given numbers divide into evenly.

How many numbers can I enter?

You can enter 2 to 10 positive whole numbers, separated by commas or spaces.

Is GCF the same as GCD and HCF?

Yes. GCF (Greatest Common Factor), GCD (Greatest Common Divisor), and HCF (Highest Common Factor) all mean the same thing - different names used in different countries.

How does the prime factorization method work?

Each number is broken into its prime factors. The GCF takes the lowest power of each prime that appears in all numbers. The LCM takes the highest power of each prime that appears in any number.

What is the relationship between GCF and LCM?

For two numbers a and b, GCF(a,b) times LCM(a,b) equals a times b. This relationship does not extend directly to three or more numbers.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/gcf-lcm-calculator/" title="GCF & LCM Calculator - Free Online Tool">Try GCF & LCM Calculator on ToolboxKit.io</a>