1. Home
  2. Maths
  3. HCF & LCM Calculator (Prime Factorisation)

HCF & LCM Calculator (Prime Factorisation)

HCF (GCD) and LCM of two or more numbers with the prime factorisation of each.

MathsGrades 9–10BeginnerStep-by-step solution

Practice questions

Textbook-style questions. Press Solve in the tool to load the values and see the full solution. Underlined words are explained below.

  1. Find the HCF and LCM of 12, 18 and 30 by prime factorisation.

  2. Find the HCF and LCM of 96 and 404, and check that HCF × LCM = product.

  3. Three bells ring every 6, 8 and 12 minutes. After how many minutes do they ring together again?

Worked example

Here's the first practice question solved in full, so you can see exactly what you'll get. Try it on paper before you read the steps.

Question: Find the HCF and LCM of 12, 18 and 30 by prime factorisation.

Plan: how this problem is solved
  1. Write the given values
  2. Write each number as a product of primes
  3. HCF: primes common to all, with the smallest power
  4. LCM: every prime, with the greatest power
Answer
HCF (highest common factor)HCF = 6
LCM (lowest common multiple)LCM = 180
Step-by-step solution
  1. Write the given values
    =12, 18, 30
  2. Write each number as a product of primes
    12=22 × 3
    18=2 × 32
    30=2 × 3 × 5
  3. HCF: primes common to all, with the smallest power
    HCF=2 × 3
    =6
  4. LCM: every prime, with the greatest power
    LCM=22 × 32 × 5
    =180
Key idea: For two numbers, HCF × LCM always equals the product of the numbers. That shortcut doesn't work for three or more.

Symbols in this solver

What each box asks for, and its unit.

SymbolWhat it meansSI unit
Numbers (separate with spaces or commas)text

Formula & concept

Highest common factor (HCF or GCD) and lowest common multiple (LCM) of two or more whole numbers, with the prime factors shown.

HCF = product of the smallest powers of common primes,   LCM = product of the greatest powers of all primes

Key idea: For two numbers, HCF × LCM always equals the product of the numbers. That shortcut doesn't work for three or more.

How to use this calculator

  1. Type the known values from your question and pick the unit for each one.
  2. Press Solve step by step.
  3. Read the plan first. It lists the steps the solution will follow. Want to try it yourself? Tick Practice mode and the answer stays hidden until you ask for it.
  4. Check the answer, then go through each numbered step. Where there's a second method, it's shown after the main one.
  5. Stuck on a word? The terms section explains it in simple language.

Frequently asked questions

How does the HCF & LCM work?
You enter the values you know, pick their units and press Solve. The tool changes everything to SI units, applies the formula HCF = product of the smallest powers of common primes, LCM = product of the greatest powers of all primes and shows you each step: given data, formula, substitution and the final answer.
What is the key idea behind it?
For two numbers, HCF × LCM always equals the product of the numbers. That shortcut doesn't work for three or more.
What if my answer doesn't match my book?
First check that you've picked the right units. Then see which constants your book uses and how many figures it rounds to. You can change the number of figures under Settings in the solver. A small difference in the last digit is usually just rounding.
Can I see how to solve it without seeing the answer?
Yes. Tick Practice mode under the solver. You'll get the plan of steps only, so you can work it out on paper. One click then shows the full solution.
Is the HCF & LCM free to use?
Yes, it's free with no sign-up. All calculations happen inside your browser and nothing you type is stored.
Which grades is it useful for?
It's made for Grades 9–10 (GCSE · IGCSE · US high school · Class 9–10 (CBSE, ICSE)). The working follows the method used in textbooks and exams.