Skip to main content
ilovecalcs logoilovecalcs.

Math · Live

Factor Calculator — all factors, prime factorisation.

Enter any positive integer up to 999,999,999 and instantly see every factor, all factor pairs, the complete prime factorisation, and number-theory properties — is it prime, perfect, or a perfect square?

How it worksReal-time

Inputs

Your number

Quick examples

Factors
12
Sum of factors
195
Prime factors
2³ × 3²

Prime factorisation

n = 72

72 = 2³ × 3²

2 distinct primes · 2^3, 3^2

Total factors

12

divisors

Type
Abundant
Sum of factors
195
Perfect square
No
Largest prime
3

All factors

12 divisors of 72

PrimeComposite
12346891218243672

indigo = prime factor

Factor pairs

6 pairs where a × b = 72

Ascending
Factor a×Factor b
1×72
2×36
3×24
4×18
6×12
8×9
Number of factors
12
τ(n) = (3+1)×(2+1) = 12
Sum of factors
195
σ(n) = 195 · proper: 123
Prime factors
2, 3
abundant: proper sum > n

Field guide

What is a factor?

A factor (also called a divisor) of a positive integer n is any positive integer that divides n exactly, leaving no remainder. Equivalently, d is a factor of n if and only if n mod d = 0.

Example: The factors of 72 are:

1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72

72 ÷ 1 = 72, 72 ÷ 2 = 36, 72 ÷ 3 = 24 … all divide evenly. 72 ÷ 5 = 14.4, not an integer, so 5 is not a factor.

Every positive integer n has at least two factors: 1 and n itself. A number with exactly two factors is called prime; all others are composite. The sole exception is 1, which has only one factor and is neither prime nor composite.

How to find all factors.

The most straightforward method is trial division: divide n by every integer from 1 up to √n. If the division is exact (no remainder), both the divisor and the quotient are factors.

For i = 1 to √n: if n mod i = 0: record i (a factor) record n/i (its pair, if different from i) Sort the results ascending.

By stopping at √n, you automatically capture both factors in each pair — halving the work. For n = 72, √72 ≈ 8.49, so you only need to check 1 through 8:

i72 ÷ iPair found
1721 × 72 = 72
2362 × 36 = 72
3243 × 24 = 72
4184 × 18 = 72
6126 × 12 = 72
898 × 9 = 72

5 and 7 don’t divide 72 evenly, so they’re skipped. The final sorted list has 12 factors. This calculator uses the same approach for every query — it runs in <2 ms even for nine-digit numbers.

Prime factorisation.

The Fundamental Theorem of Arithmetic states that every integer greater than 1 can be represented uniquely (up to ordering) as a product of prime numbers. This product is the integer’s prime factorisation.

72 = 2 × 2 × 2 × 3 × 3 = 2³ × 3²

The exponent form 2³ × 3² is the canonical prime factorisation. The algorithm starts at p = 2 and divides out as many copies of p as possible before moving to the next candidate:

72 ÷ 2 = 36 (1st factor of 2) 36 ÷ 2 = 18 (2nd factor of 2) 18 ÷ 2 = 9 (3rd factor of 2) 9 ÷ 3 = 3 (1st factor of 3) 3 ÷ 3 = 1 (2nd factor of 3) Result: 2³ × 3²

The factorisation is unique — no other combination of primes gives 72, which is why the Fundamental Theorem is so powerful.

Factor pairs.

A factor pair is a pair (a, b) where a × b = n and a ≤ b. Every factor has exactly one partner: if a is a factor then b = n/a is its pair. Because both a and b are at most n and at least 1, the pairs mirror each other across the square root: when a < √n, b > √n.

For a perfect square like 36, one pair meets in the middle: (6, 6). This is the only case where a = b, which is also why perfect squares always have an odd number of total factors.

Number of factors formula.

If n = p₁^e₁ × p₂^e₂ × … × pₖ^eₖ, then the total number of factors (the divisor function τ or σ₀) is:

τ(n) = (e₁ + 1) × (e₂ + 1) × … × (eₖ + 1)

Example: 72 = 2³ × 3²

τ(72) = (3 + 1) × (2 + 1) = 4 × 3 = 12

This formula lets you count factors instantly from the prime factorisation without listing them. The calculator shows this breakdown in the stat cards.

Special categories of numbers.

Prime numbers

A prime is a number with exactly 2 factors: 1 and itself. Primes are the building blocks of all integers — every composite number is a unique product of primes. The first few are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 …

Perfect numbers

A number is perfect if the sum of its proper divisors (all factors except itself) equals the number. The first four perfect numbers are 6, 28, 496, and 8128:

6: 1 + 2 + 3 = 6 ✓ 28: 1 + 2 + 4 + 7 + 14 = 28 ✓

Abundant and deficient numbers

Most numbers are either deficient (proper divisor sum < n) or abundant (proper divisor sum > n). Example: 12 is abundant because 1 + 2 + 3 + 4 + 6 = 16 > 12.

Perfect squares

A perfect square is n = k² for some integer k. Perfect squares always have an odd number of total factors because the factor √n pairs with itself (contributing only one factor instead of two).

Highly composite numbers

A highly composite number is a positive integer with more divisors than any smaller positive integer. Examples: 1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720 … These appear in time (60 seconds, 360 degrees, 12-hour clock) because they divide evenly by many small integers.

Applications of factorisation.

  • Greatest Common Factor (GCF): the largest factor shared by two or more numbers. Used to simplify fractions: 18/24 → divide both by GCF(18, 24) = 6 → 3/4.
  • Least Common Multiple (LCM): the smallest number divisible by all given numbers. LCM(a, b) = a × b / GCF(a, b). Used for adding fractions with different denominators.
  • Divisibility tests: factoring reveals which small numbers divide n. Essential in scheduling, measurement conversion, and pattern design.
  • Cryptography: RSA encryption relies on the difficulty of factoring very large semiprimes (products of two large primes). The security of HTTPS depends on this.
  • Number theory: the prime factorisation is used in Euler’s totient function, the Möbius function, and countless other number-theoretic identities.

Disclaimer

This calculator uses trial division and runs entirely in the browser. Inputs are limited to positive integers up to 999,999,999. All computation completes in under 2 ms. No data is sent to any server.