HomeMath › Factor Calculator

Factor Calculator

Type a whole number and instantly see whether it is prime, its complete list of factors, every factor pair, the prime factorization in exponent form, and the sum of its divisors — for anything up to a trillion.

Verdict
Prime factorization
Sum of all factors
All factors
Factor pairs

Factors, pairs, and primes

A factor divides a number cleanly, and factors always arrive in pairs that multiply back to the original — find one divisor d and n÷d comes free. That is why the search only needs to run up to the square root. A number with exactly two factors is prime; the prime factorization expresses any composite number as a product of primes with exponents, and from those exponents you can even predict how many factors exist: add 1 to each exponent and multiply (for 120 = 2³×3×5, that is 4×2×2 = 16 factors).

How it’s calculated

Trial division from 1 to √n collects each divisor d and its partner n/d. Prime factorization divides out 2, then odd candidates, until the remainder is 1 or prime. Factor count check: multiply (exponent + 1) across the prime factorization; the sum of divisors uses σ(n) = ∏(p^(e+1) − 1)/(p − 1).

Handles whole numbers up to 10¹²; negative inputs are factored by absolute value. 0 has infinitely many divisors and 1 has just itself.

Worked example

120 is composite with 16 factors: 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120. Its factor pairs run 1×120 through 10×12, its prime factorization is 2³ × 3 × 5, and its divisors sum to 360. By contrast, 97 has no divisor up to √97 ≈ 9.8, so it is prime.

Common mistakes

  • Forgetting 1 and the number itself — both always count as factors.
  • Stopping the search too early: factors above the square root exist, but only as partners of ones below it.
  • Calling 1 a prime number (it has only one factor) or 2 composite (it is the only even prime).
  • Mixing up factors with multiples — factors divide the number; multiples are divisible by it.

Where it is used

  • Math homework: divisibility, primes, and factor trees.
  • Splitting quantities into equal groups, grids, and packaging layouts.
  • Reducing fractions and finding common denominators.
  • Programming and cryptography basics — primality is the heart of RSA-style keys.

Frequently asked questions

What is the difference between factors and prime factors?

Factors are every whole number that divides evenly — 120 has sixteen of them, from 1 to 120. Prime factors are the prime building blocks whose product reconstructs the number: 120 = 2³ × 3 × 5. Every factor is some combination of those prime pieces.

How does the calculator find all the factors?

It tests every candidate up to the square root of the number. Each hit d yields the pair (d, n÷d), so only √n checks are needed — for a trillion that is a million quick divisions, done in milliseconds.

How do I know if a number is prime?

A prime has exactly two factors: 1 and itself. If no candidate up to its square root divides it, it is prime — 97 passes that test. Note that 1 is not prime (it has only one factor) and 2 is the only even prime.

What are factor pairs used for?

They enumerate every way to arrange the number as a rectangle: 120 items pack as 1×120, 2×60, 3×40, 4×30, 5×24, 6×20, 8×15, or 10×12. That is exactly the question in grid layouts, seating plans, and box packing.

Does it work with negative numbers?

Factoring is defined on the absolute value — the factors of −120 are the same as 120, with signs applied in pairs. The calculator notes when it has taken the absolute value.