Factor Calculator

Enter any whole number and the calculator lists every positive factor (divisor), its prime factorisation, all of its factor pairs, and σ(n) — the sum of its divisors — along with whether the number is prime, composite, or perfect.

#math#factor#factorization#divisors#number-theory

A whole number. Negative values are accepted and treated as their absolute value.

Number of factors

12

All factors
1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60
Prime factorisation
2^2 × 3 × 5
Factor pairs
1 × 60, 2 × 30, 3 × 20, 4 × 15, 5 × 12, 6 × 10
Sum of divisors σ(n)
168

60 has 12 positive factors. Classification: Composite.

How to use this calculator

Type a single whole number into the box and the calculator updates immediately. Commas, spaces, and underscores in the input are ignored, so 1,234,567 and 1_234_567 are both accepted. Negative numbers are treated as their absolute value, since factors are conventionally non-negative. The primary result is the number of positive factors; the breakdown lists every factor in ascending order, the prime factorisation in canonical form (smallest prime first, exponents written as p^k), every factor pair, and σ(n), the sum of all positive divisors. The explanation flags whether the input is prime, composite, or perfect.

How the calculation works

A factor (or divisor) of n is any positive integer d such that n divided by d leaves no remainder. The calculator finds them by trial division: test every integer i from 1 up to √n; whenever i divides n exactly, both i and n / i are factors. This is the standard textbook algorithm (Hardy & Wright, An Introduction to the Theory of Numbers, §1.2) and runs in O(√n) time, which is fast enough for any number that fits in JavaScript's safe-integer range. The prime factorisation is built by repeatedly dividing out the smallest prime that still divides n until what remains is 1. By the fundamental theorem of arithmetic (Euclid, Elements VII), this representation is unique up to ordering. σ(n) — the sum of divisors — is computed multiplicatively: for a prime power p^k it equals (p^(k+1) − 1) / (p − 1), and for any n it is the product of σ across its distinct prime factors.

Worked example

For 60: trial divide by 1, 2, 3, 4, 5, 6, 7 — all of 1, 2, 3, 4, 5, 6 divide 60, paired with 60, 30, 20, 15, 12, 10. After √60 ≈ 7.75 every new factor is the larger half of a pair we have already found, so the complete factor list is 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 — twelve factors in total. The prime factorisation is 60 = 2² × 3 × 5, since 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1. The factor pairs are 1×60, 2×30, 3×20, 4×15, 5×12, 6×10. σ(60) = (2³ − 1)/(2 − 1) × (3² − 1)/(3 − 1) × (5² − 1)/(5 − 1) = 7 × 4 × 6 = 168. Since the proper-divisor sum is 168 − 60 = 108 ≠ 60, the number is not perfect. Contrast 28: factors 1, 2, 4, 7, 14, 28 sum to 56, so 28 is perfect (1 + 2 + 4 + 7 + 14 = 28).

Frequently asked questions

What is the difference between a factor, a divisor, and a multiple?

A factor and a divisor of n are the same thing: a positive integer that divides n exactly. So 1, 2, 3, 4, 6, 12 are both the factors and the divisors of 12. A multiple of n is a number you get by multiplying n by some positive integer — the multiples of 12 are 12, 24, 36, 48, 60, …. Factors look downward from n; multiples look upward. Every positive integer is a factor of itself and of every one of its multiples.

What is a prime number?

A prime number is a whole number greater than 1 whose only positive factors are 1 and itself — exactly two divisors. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29. Every other whole number greater than 1 is composite: it has at least one factor strictly between 1 and itself, so its divisor count is at least three. The number 1 is neither prime nor composite (it has only one divisor), and 0 is treated separately because every non-zero integer divides 0. The calculator labels these cases automatically: prime, composite, unit (1), or zero.

Why is the prime factorisation unique?

This is the fundamental theorem of arithmetic, proved in Euclid's Elements (Book VII, Propositions 30 and 32): every integer greater than 1 can be written as a product of primes in exactly one way, up to the order of the factors. For example, 60 = 2 × 2 × 3 × 5, and no other multiset of primes multiplies to 60. The calculator displays this in canonical form — smallest prime first, repeated primes collected as p^k — so 60 appears as 2² × 3 × 5. Uniqueness is what lets you compute GCD, LCM, σ(n), and Euler's φ(n) directly from the factorisation without ambiguity.

How many factors does a number have?

If n has the prime factorisation p₁^a₁ × p₂^a₂ × … × p_k^a_k, then the number of positive divisors — written d(n) or τ(n) — is exactly (a₁ + 1)(a₂ + 1) … (a_k + 1). Each exponent in a divisor can range from 0 up to a_i independently, giving that product. Example: 60 = 2² × 3 × 5 has (2 + 1)(1 + 1)(1 + 1) = 3 × 2 × 2 = 12 divisors. A square number always has an odd number of divisors, since one of the factor pairs is i × i; every other number has an even count.

What is a perfect number?

A perfect number equals the sum of its proper divisors (every divisor except itself). The first few are 6 (= 1 + 2 + 3), 28 (= 1 + 2 + 4 + 7 + 14), 496, and 8128. Euclid proved that if 2^p − 1 is a Mersenne prime, then 2^(p−1)(2^p − 1) is perfect; Euler proved every even perfect number has this form. No odd perfect number is known, and none can exist below 10^1500 — one of the oldest unsolved problems in mathematics. The calculator flags perfect numbers automatically based on σ(n) − n = n.

What is σ(n), the sum of divisors?

σ(n) is the sum of every positive divisor of n, including 1 and n itself. For 12, σ(12) = 1 + 2 + 3 + 4 + 6 + 12 = 28. The function σ is multiplicative: σ(mn) = σ(m)σ(n) whenever m and n are coprime, which makes it cheap to compute from the prime factorisation. σ(n) appears in many classical results — perfect numbers (σ(n) = 2n), abundant numbers (σ(n) > 2n, like 12), and deficient numbers (σ(n) < 2n, like every prime). The aliquot sum σ(n) − n is the basis of the perfect / abundant / deficient classification.