Prime Factorization Calculator
This prime factorization calculator breaks any whole number from 2 up to 9,007,199,254,740,991 into primes. Type it into Number and the answer appears on every keystroke, written two ways: Exponential form, like 2³ × 3² × 5 for 360, and a plain list of Prime factors, like 2, 2, 2, 3, 3, 5. If the number is prime, it says so. There is no button to press, and it runs in your browser, so nothing you type is sent anywhere.
How to find the prime factors of a number
- Select the Number box and type a whole number. The box shows 360 as an example until you start.
- Read Exponential form for the short version, with a raised number for each prime that repeats.
- Read Prime factors for the full list, with each prime written as many times as it divides the number.
- Change a digit and both lines update at once. Clear the box to start again.
Commas, spaces and apostrophes are ignored, so 1,000,000 and 1 000 000 both work, and so do full-width digits. A decimal, a negative number, 0, 1 or a letter shows Enter a whole number greater than 1, using digits only. A number above the limit shows That number is too big. The limit is 9,007,199,254,740,991.
Reading the result: exponential form and the prime list
Both lines describe the same product. The list repeats a prime once for every time it divides the number; the exponential form counts the repeats and writes the count as a small raised number. A prime that appears once has no exponent. These are real outputs:
| Number | Exponential form | Prime factors |
|---|---|---|
| 84 | 2² × 3 × 7 | 2, 2, 3, 7 |
| 360 | 2³ × 3² × 5 | 2, 2, 2, 3, 3, 5 |
| 3,600 | 2⁴ × 3² × 5² | 2, 2, 2, 2, 3, 3, 5, 5 |
| 1,001 | 7 × 11 × 13 | 7, 11, 13 |
| 1,000,000 | 2⁶ × 5⁶ | 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5 |
| 9,007,199,254,740,991 | 6361 × 69431 × 20394401 | 6361, 69431, 20394401 |
To check an answer, multiply the primes back together: 2 × 2 × 2 × 3 × 3 × 5 = 360. Every number above 1 has exactly one prime factorization, apart from the order of the factors, so any correct method ends on the same primes.
What it says when the number is prime
A prime has no factors except itself, so its factorization is the number alone. Enter 47 and the result box says 47 is a prime number., with 47 in both Exponential form and Prime factors. That makes the page a quick way to test whether a number is prime or composite: anything that is not prime is split into primes, and the list shows the divisors that prove it. 91, for example, comes back as 7 × 13.
Prime factorization of large numbers
The calculator uses trial division: it divides by 2, then 3, then every number of the form 6k − 1 and 6k + 1, stopping at the square root of what is left. The work is done in the browser in short slices, so the page stays responsive. Most numbers finish instantly. For a very large number, a progress percentage appears under Checking divisors while it works. The slowest case, a prime close to 9 quadrillion such as 9,007,199,254,740,881, takes about half a second.
The result is exact for every whole number up to 9,007,199,254,740,991, which is 2⁵³ − 1 and the largest integer JavaScript can store without rounding. Above that limit the calculator refuses instead of guessing.
How to do prime factorization by hand
The division method is the same idea the calculator runs: divide by the smallest prime that goes in evenly, then repeat on the quotient until you reach 1.
42 ÷ 2 = 21
21 ÷ 3 = 7
7 ÷ 7 = 1
The divisors 2, 2, 3 and 7 are the prime factors.
Only primes ever need testing, and only up to the square root of the number that is left. If none of them divides it, what remains is itself prime.
What this calculator does not do
It finds prime factors and tells you when a number is prime. It does not draw a factor tree, list every divisor, or find a greatest common factor or least common multiple, and it has no copy or download button (select the text to copy it). For algebra rather than whole numbers, use the factor quadratics calculator; to check arithmetic along the way, the expression calculator evaluates a typed sum, and basic math flashcards help with the times tables that make factoring faster.
Frequently asked questions
What is the prime factorization of 360?
360 = 2 × 2 × 2 × 3 × 3 × 5, which is 2³ × 3² × 5 in exponential form. Type 360 into Number and the calculator shows both: Exponential form reads 2³ × 3² × 5 and Prime factors reads 2, 2, 2, 3, 3, 5. Multiply the list back together and you get 360.
How do I write a prime factorization in exponential form?
Count how many times each prime appears and write that count as a small raised number. For 3600 the primes are 2, 2, 2, 2, 3, 3, 5, 5, so the exponential form is 2⁴ × 3² × 5². A prime that appears once is written without an exponent. The Exponential form line of the calculator is written this way, and the Prime factors line underneath shows the same primes one by one.
How do I find the prime factorization of a large number?
Divide by the smallest prime that goes in, repeat on the result, and stop when what is left is prime. For a big number that is a lot of dividing, so type it into Number instead. The calculator accepts any whole number from 2 up to 9,007,199,254,740,991. For 1,000,000 it shows 2⁶ × 5⁶, and for 9,007,199,254,740,991 it shows 6361 × 69431 × 20394401. Commas, spaces and apostrophes in the number are ignored.
What is the prime factorization of a prime number?
A prime number is its own prime factorization, because nothing smaller than itself divides it except 1. The prime factorization of 47 is just 47. When you enter a prime, the calculator says "47 is a prime number." and both Exponential form and Prime factors show the number on its own.
How can you tell if a number is prime?
A number above 1 is prime if no prime up to its square root divides it. For 91 the square root is a little under 10, and 7 goes in (91 = 7 × 13), so 91 is not prime. Enter the number and the calculator does this check for you: a prime gets the line "... is a prime number.", and anything else is split into its prime factors.
How do I find prime factors by the division method?
Write the number, divide by the smallest prime that goes in evenly (try 2, then 3, then 5, then 7), write the quotient underneath and repeat until the quotient is 1. The primes you divided by are the prime factors. For 84: 84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, 7 ÷ 7 = 1, so 84 = 2 × 2 × 3 × 7, or 2² × 3 × 7. The calculator uses trial division, which is the same method done by the computer.
What is the biggest number this calculator can factor?
9,007,199,254,740,991, which is 2⁵³ − 1 and the largest whole number JavaScript can handle exactly. Anything above it shows "That number is too big. The limit is 9,007,199,254,740,991." rather than a wrong answer. Within the limit every result is exact, but a prime near the top takes about half a second to confirm, and a progress percentage appears under "Checking divisors" while it works.
Why does it show "Enter a whole number greater than 1, using digits only."?
Number accepts digits only, and the value must be 2 or more. Decimals, negative numbers, 0, 1 and letters all show that message. Prime factorization is defined for whole numbers above 1: 1 has no prime factors and 0 has no factorization. Commas, spaces and apostrophes used as thousands separators are fine, so 1,000,000 works.
Does it draw a factor tree or list all the factors of a number?
No. It gives the prime factors in two forms, Exponential form and Prime factors, and tells you when the number is prime. It does not draw a factor tree, list every divisor, or work out a greatest common factor or least common multiple. To draw a factor tree by hand, split the number into any two factors, then keep splitting each branch until every end is prime; the primes at the ends are the same ones the calculator lists.
Recommended
-
Casio fx-991ES Plus 2 Scientific CalculatorCheck your factors again on a calculator built for homework and exams.
-
Turing Machine Logic Board GameNumber-code deduction: a puzzle night for anyone who enjoys digging into numbers.
-
Leuchtturm1917 Dotted Notebook (A5)Dotted pages are handy for factor trees and showing your work.
Helps keep the tools free. ✨
Images are for illustration only. As an Amazon Associate I earn from qualifying purchases.