Number ยท a plain-language guide

The biggest block two numbers can share.

Every number is built from tiny prime bricks. The primes two numbers have in common build the biggest number that divides them both โ€” the HCF.

Start here
The whole idea

The HCF is the biggest thing two numbers share.

Picture two numbers as towers built from the same box of bricks. The highest common factor is the tallest tower you could build using only the bricks that appear in both โ€” the biggest number that divides them both exactly.

For 12 and 18, that shared tower is 6. This whole page is about seeing exactly where that 6 comes from โ€” and letting you find it for any pair you like.

First, three words

Factor, prime factor, HCF.

Before we hunt for the highest common factor, let's meet the words. They sound big, but each one is a small, friendly idea.

A factor of a number is any whole number that divides into it exactly, with nothing left over. The factors of 12 are 1, 2, 3, 4, 6 and 12 โ€” because each of those splits 12 into equal whole pieces. (7 is not a factor of 12, because 12 ÷ 7 leaves a messy remainder.)

A prime factor is a factor that is also prime โ€” a number bigger than 1 whose only factors are 1 and itself, like 2, 3, 5, 7 and 11. Primes are the "atoms" of numbers: you can't break them into smaller whole-number pieces. Every number can be written as a string of prime factors multiplied together, and that string is like its unique fingerprint. For example, 12 = 2 × 2 × 3, and 18 = 2 × 3 × 3.

The HCF โ€” highest common factor โ€” is the biggest number that is a factor of two numbers at the same time. "Common" just means "shared." So the HCF of 12 and 18 is the largest number that divides both 12 and 18 without a remainder.

The HCF is the biggest number that divides into two numbers exactly โ€” handy for simplifying fractions and for sharing things into equal groups.

Here's the magic trick that makes it easy: instead of testing number after number, we look at each number's prime bricks and keep only the ones they both have. Multiply those shared bricks together and you get the HCF โ€” every time. Let's build a machine that does exactly that.

Try it โ€” the Venn of prime factors

Drop two numbers in. Watch the shared bricks slide to the middle.

Pick any two numbers with the steppers or a preset chip. The page splits each into its prime bricks, drops the bricks they share into the overlap, and multiplies those to give the HCF โ€” live.

Venn diagram of prime factors Two overlapping circles. The left circle holds the prime factors of the first number, the right circle holds the prime factors of the second, and the overlap holds the primes they share.
First number
Second number
Presets
First
Second
Shared
HCF = 6

Blue-outlined tiles on the left belong only to the first number; solid tiles in the middle are shared; deep-outlined tiles on the right belong only to the second. The overlap's product is the HCF.

Worked example

Why the HCF of 12 and 18 is 6.

Let's slow the machine right down and do 12 and 18 by hand, brick by brick. First, break each number into its prime factors:

Number
Prime bricks
12
2 × 2 × 3
18
2 × 3 × 3

Now line up the bricks and keep only the ones that appear in both piles. Twelve brings a 2, 2, 3. Eighteen brings a 2, 3, 3. They can both spare one 2 and one 3 โ€” that's as far as the shared supply stretches. (Twelve has two 2s but eighteen only has one, so only one 2 is truly shared. Eighteen has two 3s but twelve only has one, so only one 3 is shared.)

Multiply the shared bricks together:

2 × 3 = 6

So 6 is the highest common factor of 12 and 18. It's a factor of 12 (12 ÷ 6 = 2) and a factor of 18 (18 ÷ 6 = 3), and nothing bigger works for both. Notice this is exactly what the Venn machine shows: the two middle tiles are 2 and 3, and 2 × 3 = 6.

One neat bonus: the bricks left outside the overlap tell a story too. Twelve keeps a spare 2 (its leftover), eighteen keeps a spare 3. Those leftovers are why 12 and 18 aren't the same number โ€” but the shared 6 is the biggest slab of "sameness" hiding inside both.

A second way to see it

The list-them-all method.

The prime-brick trick is fast and it scales beautifully, but there's an even more down-to-earth way that's great for a sanity check: just list every factor of each number, circle the ones they share, and pick the biggest. "Highest common factor" literally describes this list โ€” the highest number common to both.

Change the two numbers below and watch the shared factors turn blue. The biggest shared one glows orange: that's your HCF.

First number
Second number

Factors of 24

Factors of 36

HCF = 12

Blue tiles are shared factors; the orange tile is the highest one they share. Both methods always agree โ€” that's a lovely little proof that the prime-brick trick really works.

For small numbers, listing is quick and reassuring. But try it on two big numbers and you'll feel the pain โ€” the lists get long fast. That's exactly when the prime-brick Venn earns its keep: you only ever handle a handful of tiny primes.

Where you'll actually use it

Sharing into equal groups.

You're making party bags. You have 24 stickers and 36 sweets, and you want every bag to be identical โ€” same stickers, same sweets, nothing left over. What's the greatest number of bags you can make?

Each bag must take an equal share of the stickers, so the number of bags has to divide 24. It must also take an equal share of the sweets, so it has to divide 36 too. You want the most bags possible โ€” the biggest number that divides both 24 and 36. That's the HCF.

From the list method above (or the prime bricks 24 = 2×2×2×3 and 36 = 2×2×3×3, sharing 2×2×3), the HCF is 12. So you can make 12 identical bags, each holding 24 ÷ 12 = 2 stickers and 36 ÷ 12 = 3 sweets. Any more than 12 bags and something wouldn't divide evenly; that's the HCF doing its job.

Same idea shows up all over: cutting a 24 cm by 36 cm sheet into the largest possible equal squares (12 cm squares), arranging two class sizes into equal rows, or โ€” the classic โ€” simplifying a fraction. To reduce 12/18 to its simplest form, divide top and bottom by their HCF, 6, and you get 2/3. The HCF is the biggest simplifying step you can take in one move.

The special case

When two numbers share nothing.

Try 8 and 9 in the Venn machine. Eight is 2 × 2 × 2, and nine is 3 × 3. Line up the bricks and… there's no overlap at all โ€” not a single prime in common. The middle of the Venn is empty.

Does that mean there's no HCF? Not quite. Remember that 1 is a factor of every number โ€” 1 divides everything exactly. So even when two numbers share no prime bricks, they still share the number 1. When the biggest thing two numbers share is just 1, we say they are coprime (some books say "relatively prime").

That's why the machine reads HCF = 1 for 8 and 9, and shows an empty overlap: their only common factor is 1. Coprime numbers are handy โ€” a fraction like 8/9 is already in its simplest form, because there's nothing bigger than 1 to divide out. Two different primes, like 5 and 7, are always coprime; so are 8 and 15, or 9 and 16. Sharing nothing is a perfectly good answer.

Mini-challenge

Your turn โ€” find the HCF.

Break each pair into prime bricks in your head, keep the shared ones, and multiply. Tap the answer you think is right.

Score: 0 / 4
Carry this with you

The HCF, in three moves.

1

Break

Split each number into its prime bricks, like 12 = 2×2×3.

2

Share

Keep only the bricks that appear in both โ€” the Venn overlap.

3

Multiply

Multiply the shared bricks. That product is the HCF (or just 1 if they share none).