Factor Calculator

Every factor, every factor pair, the prime factorization and a visual factor tree for any positive integer up to 10 million.

What is a factor?

A factor of an integer n is any positive integer that divides n with no remainder. Factor pairs are the two-number products that reconstruct n; the prime factorization is the unique way to write n as a product of primes. This calculator returns all three views at once, plus a visual factor tree.

Factor calculator, piece by piece

Each card explains one section of the output above — the full factor list, factor pairs, the prime factorization, and the factor tree diagram.

All factors — every divisor of n

The first result box lists every positive integer that divides your number evenly. Under the hood the calculator only tests candidates up to √n — each hit gives two factors at once (the divisor and the quotient), which is why the list appears instantly even for seven-digit inputs.

d is a factor of n ⇔ n mod d = 0
dcandidate divisor tested from 1 to √n
1212346126 factors total
Example
Given
n = 12
Substitute
test 1, 2, 3
Answer
1, 2, 3, 4, 6, 12

Factor pairs — rectangles that make n

The second result box groups the factors into pairs (a, b) with a × b = n. Each pair is one way to arrange n items into a rectangle. Perfect squares get a self-pair like (10, 10); the calculator prints it once so the list stays clean.

a × b = n
a ≤ √n ≤ b
1 × 12 = 122 × 6 = 123 × 4 = 12tested only up to √12 ≈ 3.46
Example
Given
n = 12
Substitute
small × large
Answer
(1,12) (2,6) (3,4)

Prime factorization — how the calculator builds it

The third box shows n written as a product of primes. The tool works by peeling off the smallest prime that fits, dividing, and repeating on the quotient until it hits a prime — the sequence of divisors is the factorization. It's unique for every integer above 1.

n = p₁ × p₂ × … × pk
each pi prime
120 ÷ 2 = 6060 ÷ 2 = 3030 ÷ 2 = 1515 ÷ 3 = 5  (prime)120 = 2·2·2·3·5
Example
Given
n = 120
Substitute
peel smallest primes
Answer
2·2·2·3·5

Factor tree — the picture at the bottom

The tree diagram at the bottom of the output is the same factorization drawn as branches: split into any two factors, then split any composite leaf again, and keep going until every leaf is a prime. Primes are highlighted in the theme colour.

branch until every leaf is prime
122623
Example
Given
n = 12
Substitute
12 → 2 · 6 → 2 · 2 · 3
Answer
leaves = 2, 2, 3

Features of this calculator

  • Lists all factors of the number in ascending order
  • Shows every factor pair (a, b) with a × b = n
  • Gives the prime factorization as a plain multiplication
  • Renders a visual factor tree that matches the site theme
  • Handles inputs up to 10,000,000 without blocking the browser

Frequently asked questions

+How do I find all factors of a number?

Test every integer from 1 up to √n. Each one that divides evenly gives you two factors: the divisor itself and the quotient. Collecting those pairs gives the full list.

+What is a factor tree?

A diagram that splits a number into two factors, splits any composite factors again, and keeps going until every leaf is prime. The leaves are the prime factorization.

+Is 1 a prime factor?

No. 1 is a factor of every integer, but primes are defined as integers greater than 1, so 1 never appears in a prime factorization.

+Why is there an upper limit on the input?

Above about 10 million, browser-side trial division starts to lag noticeably. Larger inputs need specialized algorithms and dedicated servers rather than a single tab of JavaScript.

Related calculators