How to use the prime factorization calculator
- Type a positive whole number into the Number box. Commas and spaces are fine, so
1,000,003and1000003mean the same thing. - Press Calculate. The first line tells you plainly whether the number is prime or composite.
- Read the prime factors in exponent form, such as 2^3 × 3^2 × 5 for 360, along with the divisor count, the sum of divisors and Euler's phi value.
- Scroll to All positive divisors for the complete list, or use the second form to list every prime between two numbers.
- Use Copy result to paste a one-line summary into your homework, notes or code comments.
What is prime factorization?
A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. The first few are 2, 3, 5, 7, 11, 13 and 17. Every other whole number greater than 1 is composite, which means it can be built by multiplying smaller primes together. Prime factorization is the process of writing a number as exactly that product. For example, 360 = 2 × 2 × 2 × 3 × 3 × 5, which we usually shorten to 23 × 32 × 5.
The Fundamental Theorem of Arithmetic says that every whole number greater than 1 has exactly one prime factorization, ignoring the order of the factors. That uniqueness is why primes are called the building blocks of the integers, and it is the reason a factorization can be used to answer so many other questions about a number.
Why a factorization is so useful
Once you know the prime factors, a surprising amount of arithmetic becomes mechanical. To find the greatest common divisor of two numbers, take the lowest power of each shared prime. To find the least common multiple, take the highest power of every prime that appears. With 12 = 22 × 3 and 18 = 2 × 32, the GCD is 2 × 3 = 6 and the LCM is 22 × 32 = 36. Fractions can be simplified the same way, by canceling shared primes from numerator and denominator.
The factorization also tells you how many divisors a number has. Add one to each exponent and multiply the results. For 360, the exponents are 3, 2 and 1, so the number of divisors is 4 × 3 × 2 = 24. The calculator does this for you and also shows the sum of the divisors and Euler's phi function, which counts how many numbers from 1 to n share no factor with n. Phi of 360 is 96. Teachers use these values in number theory units, and programmers meet them in hashing, modular arithmetic and cryptography.
Quick rules to test whether a number is prime
You can often rule out a number by eye before reaching for a tool. Any even number above 2 is composite, because it is divisible by 2. A number whose digits add up to a multiple of 3 is divisible by 3. Anything ending in 0 or 5 is divisible by 5. The number 1 is not prime, and 2 is the only even prime. To test a number by hand, you only need to try dividing by primes up to its square root, because if a number has a factor larger than its square root, it must also have a matching factor smaller than it.
This calculator uses trial division with the efficient 6k ± 1 pattern to find the factors, and a deterministic Miller-Rabin primality test to confirm primes quickly, so even 15-digit inputs finish almost instantly on a phone. The range lister uses the sieve of Eratosthenes, the same method taught in school: write out the numbers, cross out multiples of 2, then 3, then 5, and so on, and what remains are the primes.
Handy prime facts
| Fact | Value |
|---|---|
| Primes below 100 | 25 (the largest is 97) |
| Primes below 1,000 | 168 |
| Primes below 1,000,000 | 78,498 |
| Only even prime | 2 |
| Twin prime examples | (11, 13), (17, 19), (41, 43) |
| A famous large prime | 2,147,483,647, which is 231 − 1 |
Primes also keep the internet safe. Public-key systems such as RSA rely on the fact that multiplying two very large primes is easy, while recovering them from the product is extremely hard. Real cryptographic keys use primes hundreds of digits long, far beyond what any simple calculator, including this one, is meant to factor. This tool is built for homework, puzzles, spreadsheets and everyday curiosity, not for security work.
Study and homework tips
If you are learning factor trees, try the calculator as a checker rather than a shortcut. Draw the tree for 252 on paper, split it into 4 × 63, then into 2 × 2 × 7 × 9 and finally 2 × 2 × 3 × 3 × 7, and compare your answer of 22 × 32 × 7 with the result. If the two disagree, the divisor list helps you spot where a factor went missing. Related skills such as reducing fractions or finding common denominators are easier once this is automatic. For percentages or unit conversions in the same assignment, the Percentage Calculator and the Unit Converter are handy companions.
Limits and accuracy
The tool accepts whole numbers from 1 to 999,999,999,999,999. Larger values are rejected with a clear message because JavaScript numbers lose exactness beyond that point. The range lister is capped at an upper limit of 1,000,000 and shows the first 2,000 primes it finds, with the full count always displayed. Results come from deterministic math, so you can rely on them, but as with any homework helper you should still understand the method your teacher expects.
Private by design
Every calculation happens inside your browser tab. The numbers you enter are not uploaded, logged or stored, there is no account, and the page continues to work offline after it has loaded. Close the tab and everything is gone.
Frequently asked questions
Is 1 a prime number?
No. A prime must have exactly two distinct positive divisors, and 1 has only one. Treating 1 as prime would also break the uniqueness of prime factorizations, so mathematicians define it as neither prime nor composite.
Is 2 really prime if it is even?
Yes. Its only divisors are 1 and 2, so it meets the definition. It is the only even prime, because every larger even number is divisible by 2.
How do I find the prime factors of a number?
Divide by the smallest prime that goes in evenly, then repeat with the quotient until you reach 1. For 84 you get 84 / 2 = 42, 42 / 2 = 21, 21 / 3 = 7 and 7 is prime, so 84 = 2 x 2 x 3 x 7, or 2^2 x 3 x 7.
How many divisors does a number have?
Write the prime factorization, add 1 to each exponent and multiply. For 360 = 2^3 x 3^2 x 5, the count is (3 + 1)(2 + 1)(1 + 1) = 24. The calculator shows this directly.
What is the largest number this calculator can handle?
Up to 999,999,999,999,999, which is fifteen 9s. Beyond that, ordinary JavaScript numbers can no longer represent every integer exactly, so the tool asks you to use a smaller value.
What does Euler's phi mean?
Euler's phi, also called the totient, counts the whole numbers from 1 to n that have no prime factor in common with n. For a prime p it equals p - 1. It appears in modular arithmetic and in how RSA encryption is explained.
Why does the range lister stop at 1,000,000?
Listing primes means sieving every number up to the limit, which uses memory in your browser. A cap of one million keeps the page fast on phones. For larger spans, run several smaller ranges.
Can I use this tool to break encryption?
No. Real encryption keys use primes with hundreds of digits, far outside this tool's range. It is intended for learning, homework and everyday number questions.
Are the numbers I enter sent to a server?
No. All math runs locally in your browser. Nothing is uploaded, stored or tracked, and the page works offline once loaded.
Related tools
Need custom software, a faster website or help with digital projects? The team at 4D1A can help.