Prime Number Checker and Prime Numbers List Generator
Is it prime? Proof by smallest factor, next and previous primes, and a primes list for any range.
Enter any whole number to find its prime factors and write it as a product of primes, such as .
Prime factorization of 360
2³ × 3² × 5
360 = 2³ × 3² × 5. It has 24 positive divisors, which add up to 1170.
| d | 360 ÷ d |
|---|---|
| 1 | 360 |
| 2 | 180 |
| 3 | 120 |
| 4 | 90 |
| 5 | 72 |
| 6 | 60 |
| 8 | 45 |
| 9 | 40 |
| 10 | 36 |
| 12 | 30 |
| 15 | 24 |
| 18 | 20 |
Divide by 2 (3 times)
360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45. 45 is not divisible by 2, so move on to the next prime.
Divide by 3 (2 times)
45 ÷ 3 = 15, 15 ÷ 3 = 5. 5 is not divisible by 3, so move on to the next prime.
Divide by 5
5 ÷ 5 = 1. The quotient is 1, so the factorization is complete.
Draw the factor tree
Split each composite number into a prime and what is left: 360 = 2 × 180, 180 = 2 × 90, 90 = 2 × 45, 45 = 3 × 15, 15 = 3 × 5. The circled leaves 2, 2, 2, 3, 3 and 5 are the prime factors.
Write the result in exponent form
Group equal primes with exponents, in increasing order.
Count the divisors
Each divisor picks an exponent from 0 up to e for every prime, so multiply (e + 1) over all primes.
Add the divisors
The sum of divisors multiplies the geometric series 1 + p + p² + … + pᵉ for each prime.
The calculator shows every division step and a factor tree, then counts, adds and lists all the divisors. It handles numbers up to 40 digits.
Fundamental theorem of arithmetic
Plain-text formula: n = p_1^e_1 · p_2^e_2⋯p_k^e_k
Every integer greater than 1 is a product of primes in exactly one way, apart from the order of the factors. The calculator lists the primes in increasing order.
Number of divisors
Plain-text formula: τ(n) = (e_1 + 1)(e_2 + 1)⋯(e_k + 1)
A divisor of n takes each prime with an exponent from 0 to , giving choices per prime.
Sum of divisors
Plain-text formula: σ(n) = ∏_{i = 1}^k (p_i^(e_i + 1) − 1)/(p_i − 1)
Each factor is the geometric series . Subtract n to get the sum of the proper divisors.
Euler’s totient
Plain-text formula: φ(n) = n∏_{i = 1}^k (1 − 1/p_i)
The count of integers from 1 to n that share no prime factor with n.
The exponent form is the standard answer: . The exponents carry most of the information. A number is a perfect square exactly when every exponent is even, and a perfect cube when every exponent is a multiple of 3.
If the number is prime, its factorization is the number itself, and it has exactly two positive divisors. The divisor table pairs each divisor d with n ÷ d, so you only need to search up to √n to find every factor.
For numbers with very large prime factors, the calculator may stop after about one second. It then shows the primes it found and the composite part it could not split, clearly marked. Everything shown is still correct; it is only incomplete.
Prime factorization means writing a whole number as a product of prime numbers. A prime is a whole number greater than 1 whose only positive divisors are 1 and itself: 2, 3, 5, 7, 11, 13 and so on. A number greater than 1 that is not prime is composite, and every composite number breaks down into primes.
For example, and . The fundamental theorem of arithmetic says this product is unique: apart from the order of the factors, no other set of primes multiplies to 12. That is why the prime factorization works like a fingerprint for a number.
Division method. Divide by the smallest prime that goes in evenly, and repeat with the quotient. Use 2 while the number is even, then 3, 5, 7 and so on, until the quotient is 1. The primes you divided by are the prime factors. For 72: 72 ÷ 2 = 36, 36 ÷ 2 = 18, 18 ÷ 2 = 9, 9 ÷ 3 = 3, 3 ÷ 3 = 1, so .
Factor tree method. Write the number at the top and split it into any two factors, such as 72 = 8 × 9. Keep splitting each composite branch (8 = 2 × 4, 4 = 2 × 2, 9 = 3 × 3) until every branch ends in a prime. Circle the primes at the ends of the branches: 2, 2, 2, 3, 3. Different first splits give different trees, but the circled primes are always the same.
Shortcuts. A number is divisible by 2 if its last digit is even, by 3 if its digit sum is divisible by 3, and by 5 if it ends in 0 or 5. You only need to test primes up to the square root: if no prime up to √n divides n, then n itself is prime. For 91, test 2, 3, 5 and 7 (√91 ≈ 9.5); 7 works, so 91 = 7 × 13.
These are the factorizations people look up most often. Enter any other number in the calculator above for its steps, factor tree and divisors.
| Number | Prime factorization | Expanded form | Divisors |
|---|---|---|---|
| 12 | 2² × 3 | 2 × 2 × 3 | 6 |
| 18 | 2 × 3² | 2 × 3 × 3 | 6 |
| 24 | 2³ × 3 | 2 × 2 × 2 × 3 | 8 |
| 30 | 2 × 3 × 5 | 2 × 3 × 5 | 8 |
| 36 | 2² × 3² | 2 × 2 × 3 × 3 | 9 |
| 42 | 2 × 3 × 7 | 2 × 3 × 7 | 8 |
| 48 | 2⁴ × 3 | 2 × 2 × 2 × 2 × 3 | 10 |
| 50 | 2 × 5² | 2 × 5 × 5 | 6 |
| 60 | 2² × 3 × 5 | 2 × 2 × 3 × 5 | 12 |
| 72 | 2³ × 3² | 2 × 2 × 2 × 3 × 3 | 12 |
| 84 | 2² × 3 × 7 | 2 × 2 × 3 × 7 | 12 |
| 90 | 2 × 3² × 5 | 2 × 3 × 3 × 5 | 12 |
| 100 | 2² × 5² | 2 × 2 × 5 × 5 | 9 |
| 120 | 2³ × 3 × 5 | 2 × 2 × 2 × 3 × 5 | 16 |
| 144 | 2⁴ × 3² | 2 × 2 × 2 × 2 × 3 × 3 | 15 |
| 180 | 2² × 3² × 5 | 2 × 2 × 3 × 3 × 5 | 18 |
| 1000 | 2³ × 5³ | 2 × 2 × 2 × 5 × 5 × 5 | 16 |
Greatest common divisor and least common multiple. Write both numbers in prime form. The GCD takes the smaller exponent of each shared prime, and the LCM takes the larger exponent of every prime. For and , the GCD is and the LCM is . The GCD and LCM calculator does this for up to 10 numbers.
Simplifying square roots. Each pair of equal primes comes out of the root as one prime: . The calculator shows this simplified root for every number that is not a perfect square.
Reducing fractions. Cancel the primes the numerator and denominator share: .
Small primes are removed first by trial division by every prime below 65,536. Whatever remains is tested with the Miller–Rabin test. If it is composite, Pollard’s rho method (in Brent’s faster form) looks for a factor by iterating modulo n and taking greatest common divisors. Each split piece is tested again until only primes remain.
Rho needs about steps to find a prime factor p. A 10-digit factor takes around 100,000 steps and appears almost instantly. A 20-digit factor would take billions of steps, so a product of two 20-digit primes, like the numbers used in cryptography, cannot be split here. That difficulty is exactly what keeps RSA encryption secure.
Write 1260 as a product of primes, then find how many divisors it has and their sum.
Answer: , with 36 divisors that add up to 4368. The proper divisors sum to 3108, more than 1260, so 1260 is an abundant number.
Divide the number by the smallest prime that divides it evenly, then repeat with the quotient until you reach 1. For 36: 36 ÷ 2 = 18, 18 ÷ 2 = 9, 9 ÷ 3 = 3, 3 ÷ 3 = 1, so . A factor tree gives the same primes.
A factor tree is one way to find the prime factorization. You split the number into two factors, keep splitting the composite ones, and the primes at the ends of the branches are the prime factorization. The calculator draws one for numbers up to 12 digits with at most 10 prime factors, counting repeats.
By hand, use divisibility rules to remove 2, 3 and 5 quickly, then test the primes 7, 11, 13 and so on only up to the square root of what is left. If nothing divides it by then, the remaining number is prime.
Some scientific calculators have a factor key. On the Casio fx-991EX, for example, enter the number, press =, then SHIFT and FACT. It handles whole numbers up to 10 digits and shows any part it cannot split in parentheses. This calculator handles up to 40 digits and shows the steps.
There are 25: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. Every prime factor of a number up to 10,000 is either one of these or the number left over after dividing them all out. The prime number checker tests any single number.
No. A prime has exactly two positive divisors, 1 and itself, and 1 has only one. If 1 counted as prime, factorizations would not be unique, since you could multiply by 1 as often as you like.
This is the fundamental theorem of arithmetic. It follows from Euclid’s lemma: if a prime divides a product, it divides one of the factors. So two different factorizations of the same number cannot exist.
Add 1 to each exponent and multiply. For that is divisors.
Factors (divisors) are all numbers that divide n evenly; 12 has six of them: 1, 2, 3, 4, 6 and 12. Prime factors are only the primes among them, here 2 and 3, and the prime factorization builds every other factor.
Factor out −1 and factor the absolute value: −84 = −1 × 2² × 3 × 7. Strictly, −1 is a unit rather than a prime, so it is written separately.
You can enter up to 40 digits. Numbers whose prime factors are small, or that have at most one large prime factor, factor instantly. If two or more prime factors each have more than about 12 digits, the calculator may stop after about one second and tell you which part is left unsplit.
Is it prime? Proof by smallest factor, next and previous primes, and a primes list for any range.
LCM and GCF of up to 10 numbers with steps: multiples, prime factors, Euclid’s algorithm and a coprime check.
Factor a polynomial completely, with each step labeled by method and a check by expanding.
Square, cube and nth roots in simplest radical form, with decimals and prime-factor steps.
a mod n with steps, negative numbers, power mod and modular inverses.
Exact n! with steps and every digit, plus digit count, trailing zeros, n!! and Stirling’s approximation.
Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?