Factoring Calculator

Factoring Calculator

Popular AI Skill PRO

Enter Calculation

Formula

F(N)={d∈ℤ+:Nmodd=0}⇒(d,Nd),d≤Nwhere{N=|Number|N=p1a1·p2a2⋯pkakcount=(a1+1)(a2+1)⋯(ak+1)\begin{gathered} F(N) = \{\, d \in \mathbb{Z}^{+} : N \bmod d = 0 \,\} \quad\Rightarrow\quad \left( d,\ \frac{N}{d} \right),\ \ d \le \sqrt{N} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} N &= \left| \text{Number} \right| \\ N &= p_{1}^{a_{1}} \cdot p_{2}^{a_{2}} \cdots p_{k}^{a_{k}} \\ \text{count} &= \left( a_{1}+1 \right)\left( a_{2}+1 \right) \cdots \left( a_{k}+1 \right) \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

Prime Factorization of 36
36 = 2^2 × 3^2
this number is composite
Number of factors 9
All factors 1, 2, 3, 4, 6, 9, 12, 18, 36
Factor pairs (1, 36), (2, 18), (3, 12), (4, 9), (6, 6)

Report an error on this page

What is the Factoring Calculator?

This tool takes any whole number and finds everything you need to know about its divisibility: the complete list of positive factors, all of its factor pairs, its prime factorization, and whether it is prime or composite. Factoring is a core skill in arithmetic, algebra, and number theory, and this calculator does the trial division for you instantly.

How to use it

Type an integer into the "Find the Factors of:" box and submit. Negative numbers are accepted - the calculator factors the absolute value, since factors are positive by convention. Decimals are rounded to the nearest integer. The results panel shows the prime factorization as the headline, with the factor count, full factor list, and factor pairs below.

The formula explained

To find every factor of \(N\), we only need to test possible divisors up to the square root of \(N\). For each divisor \(i\) that divides \(N\) evenly, both \(i\) and \(N/i\) are factors. This means we only check

$$i \le \lfloor \sqrt{N} \rfloor$$

This is far faster than checking every number up to \(N\). The prime factorization repeatedly divides out the smallest prime (2, then 3, 5, 7, ...) until only 1 remains, recording each prime and how many times it appears as an exponent.

$$N = p_1^{a_1} \times p_2^{a_2} \times \cdots \times p_k^{a_k}$$
Advertisement
Prime factorization of 60 shown as a factor tree branching into prime factors 2, 2, 3, 5
A factor tree breaks a number down into its prime factors.

Worked example: 21

The square root of 21 is about 4.58, so we test 1, 2, 3, 4. We find \(21 = 1 \times 21\) and \(21 = 3 \times 7\), giving factors 1, 3, 7, 21 (four factors) and pairs (1, 21) and (3, 7). Dividing 21 by 3 leaves 7, which is prime, so

$$21 = 3 \times 7$$

Because it has more than two factors, 21 is composite.

Factor pairs of 21 shown as rectangle arrays: 1 by 21 and 3 by 7
The number 21 has two factor pairs: \(1 \times 21\) and \(3 \times 7\).

More Worked Examples: 36, 60 and 97

Each example uses the same method as the calculator: test whole-number divisors \(d\) up to \(\sqrt{N}\), pair each with \(N/d\), then count the factors from the prime exponents.

Example 1: N = 36 (a perfect square)

  1. \(\sqrt{36} = 6\), so test \(d = 1\) to \(6\).
  2. Divisors that work: 1, 2, 3, 4, 6. (5 does not: \(36 \bmod 5 = 1\).)
  3. Factor pairs: (1, 36), (2, 18), (3, 12), (4, 9), (6, 6). The pair (6, 6) repeats the same factor because 36 is a perfect square.
  4. All factors: 1, 2, 3, 4, 6, 9, 12, 18, 36.
  5. Prime factorization: \(36 = 2^{2} \cdot 3^{2}\).
  6. Count: \((2+1)(2+1) = 9\) factors, which matches the list. Perfect squares always have an odd number of factors: 9.

Example 2: N = 60

  1. \(\sqrt{60} \approx 7.75\), so test \(d = 1\) to \(7\).
  2. Divisors that work: 1, 2, 3, 4, 5, 6. (7 does not: \(60 = 8 \cdot 7 + 4\).)
  3. Factor pairs: (1, 60), (2, 30), (3, 20), (4, 15), (5, 12), (6, 10). That is six pairs.
  4. Prime factorization: \(60 = 2^{2} \cdot 3^{1} \cdot 5^{1}\).
  5. Count: \((2+1)(1+1)(1+1) = 3 \cdot 2 \cdot 2 = 12\) factors, and six pairs × 2 = 12.
  6. All factors: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60.

Example 3: N = 97 (a prime)

  1. \(\sqrt{97} \approx 9.85\), so only divisors up to 9 need testing. Testing the primes 2, 3, 5, 7 is enough, since any other divisor up to 9 is a multiple of one of them.
  2. \(97 = 48 \cdot 2 + 1\) (remainder 1), \(97 = 32 \cdot 3 + 1\) (remainder 1), \(97 = 19 \cdot 5 + 2\) (remainder 2), \(97 = 13 \cdot 7 + 6\) (remainder 6).
  3. No divisor other than 1 divides 97, so its only factor pair is (1, 97).
  4. Prime factorization: \(97 = 97^{1}\), so the count is \((1+1) = 2\) factors. 97 is prime.

Prime Numbers and Divisibility Rules Reference

The 25 primes up to 100

Range Primes
1–25 2, 3, 5, 7, 11, 13, 17, 19, 23
26–50 29, 31, 37, 41, 43, 47
51–75 53, 59, 61, 67, 71, 73
76–100 79, 83, 89, 97

That is 9 + 6 + 6 + 4 = 25 primes. The number 2 is the only even prime.

Divisibility rules

Divisor Rule Example
2 Last digit is even (0, 2, 4, 6, 8) 418 ends in 8, so it is divisible by 2
3 Digit sum is divisible by 3 123: 1+2+3 = 6, so divisible by 3
4 Last two digits form a number divisible by 4 516: 16 = 4 · 4, so divisible by 4
5 Last digit is 0 or 5 735 ends in 5
6 Divisible by both 2 and 3 138 is even and 1+3+8 = 12, so divisible by 6
8 Last three digits form a number divisible by 8 3,128: 128 = 16 · 8, so divisible by 8
9 Digit sum is divisible by 9 729: 7+2+9 = 18, so divisible by 9
10 Last digit is 0 470 ends in 0
11 Alternating digit sum is divisible by 11 (including 0) 2,728: 2 − 7 + 2 − 8 = −11, so divisible by 11
Advertisement

Factoring Terms Explained

Factor (divisor)
A positive integer that divides a number exactly, with no remainder. 4 is a factor of 12 because \(12 \bmod 4 = 0\).
Multiple
The result of multiplying a number by an integer. 12, 24 and 36 are multiples of 12. If \(a\) is a factor of \(b\), then \(b\) is a multiple of \(a\).
Factor pair
Two factors whose product is the number, such as (3, 20) for 60. Checking divisors up to \(\sqrt{N}\) finds every pair.
Prime number
An integer greater than 1 with exactly two positive factors: 1 and itself (for example 2, 3, 5, 97).
Composite number
An integer greater than 1 with more than two positive factors (for example 12 or 91).
Prime factorization
Writing a number as a product of primes, such as \(60 = 2^{2} \cdot 3 \cdot 5\). By the fundamental theorem of arithmetic, it is unique apart from the order of the factors.
Perfect square
An integer that is the square of an integer (such as 36 = 6²). In its prime factorization every exponent is even, and it has an odd number of factors.
Unit (1)
The number 1 is a factor of every integer. It is neither prime nor composite, which keeps prime factorization unique.
Coprime
Two integers whose only common positive factor is 1, i.e. their greatest common divisor is 1 (for example 8 and 15). Coprime numbers need not be prime themselves.
Number of factors
If \(N = p_{1}^{a_{1}} \cdot p_{2}^{a_{2}} \cdots p_{k}^{a_{k}}\), the number of positive factors equals the product of (exponent + 1) over all primes: \((a_{1}+1)(a_{2}+1)\cdots(a_{k}+1)\).

FAQ

Is 1 prime or composite? Neither. By definition a prime has exactly two distinct factors; 1 has only one, so it is a unit.

What about 0? Every integer divides 0, so it is undefined for factoring and reported as neither prime nor composite.

Why do perfect squares have an odd number of factors? Because the square root pairs with itself (for 36, the pair is (6, 6)), so that factor is counted once instead of twice.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators