About this tool
Every whole number greater than 1 is either prime or a product of primes, and that product is unique apart from the order of the factors (the fundamental theorem of arithmetic). Prime factorization is the basis for simplifying fractions, finding the GCD and LCM, simplifying square roots and counting divisors. This calculator factors numbers of up to 40 digits right in your browser with exact arithmetic.
How it works
Enter a whole number of 2 or more. The calculator writes it as a product of primes in exponent form, such as , and shows the division ladder: divide by the smallest prime factor again and again until 1 is left.
You also get the number of divisors and their sum, the full list of divisors when there are at most 1,000, whether the number is prime, and the nearest primes below and above it. Thousands separators such as 1,001 are fine.
Example
Factor 360 with a division ladder: , , , , and 5 is prime. So . It has divisors.
A larger case: , whose largest prime factor is 6857.
Prime factorization table
Prime factorizations from 2 to 60
- 2 = 2
- 3 = 3
- 4 = 2²
- 5 = 5
- 6 = 2 × 3
- 7 = 7
- 8 = 2³
- 9 = 3²
- 10 = 2 × 5
- 11 = 11
- 12 = 2² × 3
- 13 = 13
- 14 = 2 × 7
- 15 = 3 × 5
- 16 = 2⁴
- 17 = 17
- 18 = 2 × 3²
- 19 = 19
- 20 = 2² × 5
- 21 = 3 × 7
- 22 = 2 × 11
- 23 = 23
- 24 = 2³ × 3
- 25 = 5²
- 26 = 2 × 13
- 27 = 3³
- 28 = 2² × 7
- 29 = 29
- 30 = 2 × 3 × 5
- 31 = 31
- 32 = 2⁵
- 33 = 3 × 11
- 34 = 2 × 17
- 35 = 5 × 7
- 36 = 2² × 3²
- 37 = 37
- 38 = 2 × 19
- 39 = 3 × 13
- 40 = 2³ × 5
- 41 = 41
- 42 = 2 × 3 × 7
- 43 = 43
- 44 = 2² × 11
- 45 = 3² × 5
- 46 = 2 × 23
- 47 = 47
- 48 = 2⁴ × 3
- 49 = 7²
- 50 = 2 × 5²
- 51 = 3 × 17
- 52 = 2² × 13
- 53 = 53
- 54 = 2 × 3³
- 55 = 5 × 11
- 56 = 2³ × 7
- 57 = 3 × 19
- 58 = 2 × 29
- 59 = 59
- 60 = 2² × 3 × 5
The 25 primes below 100
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
A number is prime when its factorization is just itself. To test a number n for prime factors by hand, you only need to try primes up to .
Assumptions and limits
Numbers of up to 40 digits are accepted. Small factors are found by trial division and larger ones with Pollard's rho method, within a fixed amount of work so the page stays responsive. If a number has two very large prime factors (roughly 13 digits or more each), the calculator reports the part it could not split. Primality is proven for numbers below ; larger primes are reported as probable primes after 13 Miller–Rabin tests.
Frequently asked questions
What is prime factorization?
It is writing a number as a product of prime numbers. For example . Apart from the order, there is only one way to do it.
How do you make a factor tree?
Split the number into any two factors, then keep splitting each factor that is not prime until only primes remain at the ends of the branches. Whichever split you start with, you end up with the same primes. The division ladder used here is the same idea, always dividing by the smallest prime.
How do I find the number of divisors?
Add 1 to each exponent in the prime factorization and multiply. For that is divisors.
Is 1 a prime number?
No. A prime has exactly two divisors, 1 and itself, and 1 has only one. Leaving 1 out keeps factorizations unique. 2 is the only even prime.
How does prime factorization help with GCD and LCM?
The GCD takes each common prime with its smaller exponent and the LCM takes every prime with its larger exponent. For and : the GCD is and the LCM is .
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
nWhole number | whole number of any length | required |
Examples
?n=1001?n=600851475143
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="prime_factorization_calculator"]