DEV Community

Faisal Raza
Faisal Raza

Posted on

Finding All Factors of a Number: A Simple Method

Finding all the factors of a number sounds like tedious trial and error, but there is a simple method that makes it fast and guarantees you won't miss any. Let's walk through it.

What is a factor?

A factor of a number is any whole number that divides it evenly, leaving no remainder. For example, the factors of 12 are 1, 2, 3, 4, 6, and 12 — because 12 ÷ 2 = 6 exactly, 12 ÷ 3 = 4 exactly, and so on. Finding factors comes up constantly: simplifying fractions, working with ratios, and solving everyday math problems.

The simple method: you only need to check up to the square root

Here's the key insight: factors come in pairs. If a × b = n, then both a and b are factors of n. And whenever a is larger than √n, its partner b is smaller than √n. That means once you've tested every integer from 1 up to √n, you've found every pair — there is nothing left to discover above √n.

The steps:

  1. Find √n and round it down to a whole number.
  2. Test each integer from 1 up to that number. If it divides n evenly, record both it and its partner (n ÷ divisor).
  3. List everything you found, in order.

Because you always record the partner, you can never miss a factor — and you do far fewer checks than testing every number up to n.

A fully worked example: all the factors of 48

√48 ≈ 6.93, so we round down and test 1 through 6:

  • 48 ÷ 1 = 48 → factors 1 and 48
  • 48 ÷ 2 = 24 → factors 2 and 24
  • 48 ÷ 3 = 16 → factors 3 and 16
  • 48 ÷ 4 = 12 → factors 4 and 12
  • 48 ÷ 5 = 9.6 → not a whole number, so 5 is not a factor
  • 48 ÷ 6 = 8 → factors 6 and 8

Sorted in order, the complete list of factors of 48 is: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48 — ten factors, and we only had to do six checks.

A quick way to double-check your work

Once you're comfortable with the method, it's handy to verify your answers — especially with bigger numbers. I usually run the number through FactorCalculator.org to double-check: it's a free factor calculator that lists all the factors instantly, so you can confirm you didn't miss one.

Try it with a number of your own, like 72 or 100 — do the method by hand first, then check your answer. You'll build number sense fast.

Top comments (0)