Skip to content

Factor Calculator

List every factor of a whole number, its factor pairs and prime factorization, with the number and sum of factors and checks for prime and perfect numbers.

  • Free, no sign-up
  • Runs in your browser
  • Math
Any whole number from −1,000,000,000,000,000 to 1,000,000,000,000,000 (1015). Commas are allowed as thousands separators.
Read the guide How to Find All the Factors of a Number

How to use the factor calculator

Type a whole number and press Find factors. The result card shows the prime factorization, how many positive factors the number has, their sum, and whether the number is prime or perfect. The details card below lists every positive factor and all factor pairs.

You can enter any whole number from −1,000,000,000,000,000 to 1,000,000,000,000,000 (10^15). Commas as thousands separators are fine; decimals are not.

What is a factor?

A factor (or divisor) of a number divides it exactly, with no remainder. A factor pair is two factors that multiply to the number, such as 3 × 12 = 36. Every number greater than 1 has at least the pair 1 × n.

The method

The calculator first finds the prime factorization by trial division: it divides by 2, then 3, then candidates of the form 6k ± 1, until the remaining part has no divisor up to its square root. Every factor is then a product of those primes, with each exponent between zero and its value in the factorization.

From n = p₁^a × p₂^b × …:

  • Number of factors = (a + 1) × (b + 1) × …
  • Sum of factors = (p₁^(a+1) − 1) ÷ (p₁ − 1) × (p₂^(b+1) − 1) ÷ (p₂ − 1) × …

Worked example: 36

  • Prime factorization: 36 = 2² × 3²
  • Number of factors: (2 + 1) × (2 + 1) = 9
  • Factors: 1, 2, 3, 4, 6, 9, 12, 18, 36
  • Factor pairs: 1 × 36, 2 × 18, 3 × 12, 4 × 9, 6 × 6
  • Sum of factors: (2³ − 1) ÷ 1 × (3³ − 1) ÷ 2 = 7 × 13 = 91

Because 36 is a perfect square, its middle pair is 6 × 6 and it has an odd number of factors.

Prime, perfect, abundant and deficient

  • A prime number has exactly two factors, 1 and itself. The number 1 is neither prime nor composite.
  • The proper factors are all factors except the number itself. If they add up to exactly the number, it is perfect: 6 = 1 + 2 + 3 and 28 = 1 + 2 + 4 + 7 + 14.
  • If they add up to more, the number is abundant (36: 91 − 36 = 55, which is more than 36). If less, it is deficient (every prime is deficient).

Good to know

  • Zero has infinitely many factors, because every non-zero whole number divides 0, so no list is shown.
  • For a negative number, the factors are the factors of its absolute value with either sign. The calculator lists the positive ones and writes the factorization with a −1 in front, for example −12 = −1 × 2² × 3.
  • Below 10^15, a number can have up to 26,880 factors. All of them are listed; the pair table shows the first 1,000 pairs.
  • Large primes take the longest to check, but even the biggest numbers allowed finish in well under a second in a modern browser.

Frequently asked questions

What is the difference between factors and prime factors?

Factors are all whole numbers that divide a number exactly. Prime factors are only the prime numbers among them, written so that their product gives the number. For 12 the factors are 1, 2, 3, 4, 6 and 12, while the prime factorization is 2² × 3.

Why does a perfect square have an odd number of factors?

Factors normally come in pairs, a × b. For a perfect square one pair uses the same number twice, such as 6 × 6 for 36, so that factor is counted only once and the total is odd.

Is 1 a prime number?

No. A prime has exactly two different factors, 1 and itself. The number 1 has only one factor, so it is neither prime nor composite.

How large a number can I factor?

Up to 1,000,000,000,000,000 (10^15) in either direction. Within that range the answer is exact. Larger numbers would need more advanced methods than trial division to stay fast.

What is a perfect number?

A number whose proper factors, all factors except itself, add up to the number. The first four are 6, 28, 496 and 8,128. Every even perfect number has the form 2^(p−1) × (2^p − 1), where 2^p − 1 is prime.