Home / Math

Prime Number Checker and Prime Factorization Calculator

Our prime number checker tells you if a whole number is prime and shows every divisor. It also works as a prime factorization calculator that splits any number into its prime factors. You can list all primes in a range too, up to 10 million.

What Is a Prime Number?

A prime number is a whole number greater than 1 that has exactly two divisors, 1 and itself. The first primes are 2, 3, 5, 7, 11 and 13. The number 2 is the only even prime, because every other even number divides by 2.

A composite number has more than two divisors, like 12 or 91. The number 1 is neither prime nor composite. The tool labels all three cases for you.

How to Use the Prime Number Checker

  • Pick Check one number or List primes in a range.
  • Type a whole number from 1 up to 9,007,199,254,740,991.
  • Read the status, the prime factorization and the divisors.
  • In range mode, enter a start and an end up to 10,000,000.

Commas and spaces in the number are ignored, so you can paste 1,000,003 directly. The page updates as you type and needs no button. Results for numbers up to 10 million also show where a prime sits in the list of all primes.

Prime Factorization Calculator

Every whole number above 1 is either prime or a product of primes in exactly one way. This fact is called the fundamental theorem of arithmetic. The prime factorization calculator finds that product and writes repeated factors as powers. For example, 360 becomes 2³ × 3² × 5.

NumberPrime factorizationDivisors
122² × 36
842² × 3 × 712
3602³ × 3² × 524
10017 × 11 × 138
97972

Factors help you simplify fractions or find a greatest common factor and least common multiple. A number with many small prime factors, like 360, has many divisors. A number with one prime factor has just two.

How the Tool Tests Numbers

Like any prime number calculator, ours checks small numbers with trial division, which tries divisors up to the square root. Larger numbers use the Miller Rabin test with twelve fixed bases, which is exact for every number this page accepts. Factoring then divides out the small primes until the rest is prime. Numbers with two large prime factors take longest, because the search runs up to the smaller factor.

How to Check a Prime by Hand

You can test a number without any tool. Find its square root, then try dividing by each prime up to that root. If none divides evenly, the number is prime. For 97 the root is just under 10, so you only test 2, 3, 5 and 7.

  • A number ending in 0, 2, 4, 5, 6 or 8 divides by 2 or 5.
  • A number divides by 3 when its digits add up to a multiple of 3.
  • A number divides by 11 when the alternating sum of its digits is a multiple of 11.

The same method gets slow for large numbers, since a 15 digit number has a root in the tens of millions. A prime number checker avoids that slow search by using the Miller Rabin test. It reaches an exact answer in a fraction of a second.

Prime Number Checker Examples

Is 97 Prime?

Enter 97. The prime number checker returns Prime number and shows only the divisors 1 and 97. It also reports that 97 is the 25th prime and that the next prime is 101.

A Mersenne Prime

Enter 2147483647, which equals 2^31 − 1. The tool confirms it is prime. The previous prime is 2,147,483,629 and the next is 2,147,483,659.

A Number That Looks Prime

Enter 1001. It feels prime, yet it equals 7 × 11 × 13. The prime factorization calculator lists eight divisors and a sum of divisors of 1,344.

Divisors, Sums and Perfect Numbers

The tool lists every divisor and adds them up. For 28 the divisors are 1, 2, 4, 7, 14 and 28, which sum to 56. Because 56 equals twice 28, the number is perfect, like 6 and 496.

The prime factorization calculator also gives the divisor count directly. Add 1 to each exponent and multiply the results. For 360 that is 4 × 3 × 2, which equals 24.

Common Mistakes with Primes

  • Calling 1 prime. A prime needs exactly two divisors.
  • Assuming every odd number is prime. The numbers 9, 15, 21 and 91 are odd and composite.
  • Forgetting that 2 is prime and even.
  • Testing divisors beyond the square root, which wastes time.

Most wrong answers come from the first two items. The prime number checker avoids both by listing the actual divisors, and the prime factorization calculator shows how each number is built. If a result surprises you, check the divisor list.

List of Prime Numbers

Switch to range mode to see every prime between two values. Between 1 and 100 there are 25 primes, 8 pairs of twin primes and a largest gap of 8. Twin primes differ by 2, like 11 and 13 or 71 and 73. The list is cut at 300 numbers so the page stays fast.

RangePrimes
1 to 10025
1 to 1,000168
1 to 10,0001,229
1 to 100,0009,592
1 to 1,000,00078,498

Primes thin out as numbers grow. About one in four numbers is prime below 100, and about one in 13 is prime below 1,000,000. Range mode works as a prime number generator for any span you choose.

Why Primes Matter

Prime numbers are the building blocks of whole numbers, which is why number theory studies them closely. Modern encryption such as RSA relies on the fact that multiplying two large primes is easy while splitting the product is hard. Hash tables and random number generators also use primes. The largest known prime has tens of millions of digits.

Why Use Our Prime Number Checker

It checks, factors and lists in one place, and the range mode doubles as a prime number generator. Every answer comes with the divisors so you can see the reason. Type a number into the prime factorization calculator and check it now.

Frequently asked questions

Is 1 a prime number?

No, because it has only one divisor.

Is 2 prime?

Yes, and it is the only even prime.

What is the largest number this prime number checker accepts?

It accepts up to 9,007,199,254,740,991, which is 2^53 − 1.

How does a prime number calculator find factors?

It divides out the smallest primes first and stops when the rest is prime.

Can I get a list of prime numbers?

Yes, use range mode with an end value up to 10,000,000.

How does the prime factorization calculator show repeated factors?

It writes them as powers, so 2 × 2 × 2 appears as 2³.

Is it free to use?

Yes, it is free and runs in your browser.

Related calculators

Other tools people use alongside the prime number checker.

Browse all calculators