GCF Calculator – Greatest Common Factor & LCM

Find the greatest common factor (GCF, also called HCF or GCD) and the least common multiple (LCM) of up to 10 numbers, with Euclid’s algorithm and prime factorisation steps.

Positive integers only, up to 10 numbers. Negative signs are ignored.

Try an example:

Advertisement

Reviewed by Muhammad Tayyab (MSc Mathematics) · Last updated: 4 November 2026

What is the greatest common factor (GCF)?

This GCF calculator is also a LCM calculator: type your numbers once and get the greatest common factor and the least common multiple together, with the working shown. It works as an HCF calculator and a GCD calculator too, and you can use it as a quick GCF LCM finder for homework, fractions and exam practice.

The greatest common factor (GCF) — also called the highest common factor (HCF) or greatest common divisor (GCD) — is the largest whole number that divides evenly into every number in a list. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 without a remainder. All three names (GCF, HCF, GCD) refer to exactly the same value; different regions and textbooks prefer different terms. You may occasionally see the phrase “highest common multiple” — that is a common misnomer for HCF, since multiples go on forever and have no highest value. The correct concept is the highest common factor. Similarly, “lowest common factor” is not a standard term: the lowest common factor of any two positive numbers is always 1.

How to find the GCF

There are three common methods. Each gives the same answer.

1. Listing factors

List all factors of each number, then pick the largest one that appears in every list. For 12 and 18: factors of 12 are 1, 2, 3, 4, 6, 12; factors of 18 are 1, 2, 3, 6, 9, 18. The common factors are 1, 2, 3, 6, so the GCF is 6.

2. Prime factorisation

Write each number as a product of primes. The GCF is the product of the lowest power of each prime that appears in every number. For and , the common primes are 2 and 3; take the lowest powers: .

3. Euclid’s algorithm

Repeatedly replace the larger number with the remainder when the larger is divided by the smaller. For 48 and 18: ; ; . The last non-zero divisor is 6, so .

How to find the LCM

The least common multiple (LCM) is the smallest positive number that is a multiple of every number in the list. You can find it by:

  • Listing multiples: list multiples of each number until a common one appears. For 12 and 18: multiples of 12 are 12, 24, 36…; multiples of 18 are 18, 36…; so .
  • Prime factorisation: take the highest power of every prime that appears in any number. For and , .
  • Using the GCF formula (two numbers only): . For 12 and 18: .

GCF vs LCM

Feature GCF (HCF/GCD) LCM
Definition Largest number that divides all inputs Smallest number that all inputs divide
Size relative to inputs
Typical use Simplifying fractions, grouping, tiling Adding fractions, scheduling recurring events

Worked examples

Example 1: GCF of 12 and 18

  1. Euclid: , → .
  2. LCM using identity: .

Example 2: GCF of 36 and 48

  1. Euclid: , → .
  2. LCM: .

Example 3: GCF of 24 and 36

  1. Euclid: , → .
  2. LCM: .

Example 4: GCF of 8, 12 and 20

  1. ; .
  2. ; .

Example 5: Prime factorisation of 36 (perfect square)

  1. .
  2. The square root of 36 is . For more, try the Square Root Calculator.

Find the greatest common factor and least common multiple: solved pairs

Textbooks often ask you to “find the greatest common factor and least common multiple” of two numbers. These are common pairs with their GCF (HCF) and LCM. Each GCF comes from Euclid’s algorithm, and each LCM from . Type any pair into the calculator above to see the full steps.

Numbers GCF (HCF) LCM Euclid’s steps
32 and 176 16 352 176 = 5 × 32 + 16; 32 = 2 × 16 + 0
10 and 185 5 370 185 = 18 × 10 + 5; 10 = 2 × 5 + 0
8 and 236 4 472 236 = 29 × 8 + 4; 8 = 2 × 4 + 0
14 and 245 7 490 245 = 17 × 14 + 7; 14 = 2 × 7 + 0
20 and 190 10 380 190 = 9 × 20 + 10; 20 = 2 × 10 + 0
24 and 160 8 480 160 = 6 × 24 + 16; 24 = 1 × 16 + 8; 16 = 2 × 8 + 0
12 and 18 6 36 18 = 1 × 12 + 6; 12 = 2 × 6 + 0
36 and 48 12 144 48 = 1 × 36 + 12; 36 = 3 × 12 + 0

Factors of common numbers

A factor of a number divides it exactly with no remainder. Listing factors is the simplest way to find a GCF by hand: the largest factor shared by every number is the answer.

Number All factors
8 1, 2, 4, 8
10 1, 2, 5, 10
12 1, 2, 3, 4, 6, 12
16 1, 2, 4, 8, 16
18 1, 2, 3, 6, 9, 18
20 1, 2, 4, 5, 10, 20
24 1, 2, 3, 4, 6, 8, 12, 24
36 1, 2, 3, 4, 6, 9, 12, 18, 36

Real-world uses

  • Simplifying fractions: divide numerator and denominator by their GCF. Use the Fraction Calculator to check your work.
  • Tiling and packaging: cutting a rectangular floor into equal square tiles uses the GCF of the side lengths.
  • Grouping: dividing items into equal groups with no leftovers uses the GCF.
  • Scheduling recurring events: buses, bells or alarms that repeat at different intervals meet again after the LCM of the intervals.

Common mistakes to avoid

  • Confusing GCF with LCM. GCF ≤ smallest input; LCM ≥ largest input.
  • Applying the GCF-LCM identity to three or more numbers. It holds only for two numbers.
  • Stopping Euclid too early. Continue until the remainder is 0.
  • Missing a prime factor in LCM. Use the highest power of every prime that appears.
  • Using negative numbers. GCF and LCM are defined for positive integers.
  • Assuming GCF = 1 means the numbers are prime. They are coprime, but neither has to be prime (e.g. 8 and 9).

FAQ

What is the difference between GCF and LCM?

The greatest common factor (GCF, also called HCF or GCD) is the largest number that divides evenly into all the numbers. The least common multiple (LCM) is the smallest number that all the numbers divide evenly into. For 12 and 18, GCF is 6 and LCM is 36.

How are GCF and LCM related?

For two positive integers a and b, GCF(a, b) times LCM(a, b) equals a times b. For 12 and 18: GCF = 6, LCM = 36, and 6 times 36 = 216 = 12 times 18. This relationship does not extend directly to three or more numbers.

How do I find the GCF using Euclid's algorithm?

Repeatedly replace the larger number with the remainder when the larger is divided by the smaller. When the remainder is zero, the last non-zero divisor is the GCF. For 48 and 18: 48 mod 18 = 12, 18 mod 12 = 6, 12 mod 6 = 0, so GCF = 6.

How do I find the LCM using prime factorisation?

Write each number as a product of primes, then take the highest power of each prime that appears. For 12 = 2 squared times 3 and 18 = 2 times 3 squared, the LCM is 2 squared times 3 squared = 4 times 9 = 36.

Can LCM and GCF be found for more than two numbers?

Yes. For GCF, apply Euclid's algorithm iteratively: GCF(a, b, c) = GCF(GCF(a, b), c). For LCM, use LCM(a, b, c) = LCM(LCM(a, b), c). This calculator accepts up to ten numbers.

What if all the numbers are zero?

GCF of any set that includes zero is defined as the GCF of the non-zero numbers. If all numbers are zero, both GCF and LCM are undefined. LCM of a set that includes zero is zero.

Is HCF the same as GCF?

Yes. HCF (highest common factor) is the same as GCF (greatest common factor) and GCD (greatest common divisor). Different regions and textbooks use different names for the same value.

What is the GCF of two prime numbers?

The GCF of two distinct prime numbers is always 1, because they share no common factor other than 1. For example, GCF(7, 13) = 1.

What is the GCF of 0 and a number?

GCF(0, n) = n for any positive integer n, because every number divides 0 and n divides itself. If all numbers are zero, the GCF is undefined.

How do I simplify a fraction using the GCF?

Find the GCF of the numerator and denominator, then divide both by it. For example, to simplify 24/36: GCF(24, 36) = 12, so 24 ÷ 12 = 2 and 36 ÷ 12 = 3, giving 2/3.

What is the GCF and LCM of 32 and 176?

GCF(32, 176) = 16 and LCM(32, 176) = 352. Euclid: 176 = 5 × 32 + 16, then 32 = 2 × 16 + 0, so the GCF is 16. LCM = (32 × 176) ÷ 16 = 352.

Is there a highest common multiple or greatest common multiple?

No. Multiples of a number go on forever, so there is no highest or greatest common multiple. People searching for a highest common multiple calculator usually mean the highest common factor (HCF), which is the same as the GCF. Likewise, the lowest common factor of any numbers is always 1.

What are the factors of 8, 10 and 12?

The factors of 8 are 1, 2, 4, 8. The factors of 10 are 1, 2, 5, 10. The factors of 12 are 1, 2, 3, 4, 6, 12. The common factors of 8, 10 and 12 are 1 and 2, so their GCF is 2.

How do I find the square root of 36 by prime factorisation?

Write 36 as a product of primes: 36 = 2 × 2 × 3 × 3 = 2² × 3². Pair the equal primes and take one from each pair: √36 = 2 × 3 = 6.

Related tools

Browse all Tools & Calculators

Related Hira Academy resources

LCM and GCF underpin fractions and factorisation in school maths, from middle school through high school. Students following the Pakistan board syllabus will also find these useful: Class 9 notes and Class 10 notes.

↑