Free Prime Number Checker — Test Primality Instantly

Check if a number is prime with visual factorization

Check if a Number is Prime

Enter any whole number to check primality, see its factors, and explore nearby primes.

Prime Factorization
All Divisors
Nearby Numbers

About This Prime Number Checker

Prime Number Checker is a free tool that tests whether any whole number is prime. Enter a number and get an instant answer: prime, composite, or neither. For composite numbers, the tool displays the full prime factorization, all divisors, and nearby primes on a visual number line.

A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. The number 1 is not prime (it has only one divisor). The number 0 is not prime (it has infinitely many divisors). Every integer greater than 1 is either prime or can be expressed as a unique product of primes — this is the Fundamental Theorem of Arithmetic.

How the Primality Test Works

This tool uses trial division: it checks whether the input number is divisible by any integer from 2 up to its square root. If no divisor is found, the number is prime. Trial division is efficient for numbers up to several billion, which covers any value you would type into a web tool.

For composite numbers, the tool also computes the prime factorization by repeatedly dividing by the smallest prime factor until the quotient is 1. It then lists all divisors by pairing factors below and above the square root.

Classification Definition Examples
Prime Exactly two divisors: 1 and itself 2, 3, 5, 7, 11, 13, 97
Composite More than two divisors 4, 6, 8, 9, 12, 100
Neither Does not meet the prime definition 0, 1

Worked Examples

Example 1: Is 97 prime?

The square root of 97 is approximately 9.85. Test divisors 2, 3, 5, 7, and 9:

  • 97 ÷ 2 = 48.5 (not a whole number)
  • 97 ÷ 3 = 32.33... (not a whole number)
  • 97 ÷ 5 = 19.4 (not a whole number)
  • 97 ÷ 7 = 13.86... (not a whole number)

No integer from 2 to 9 divides 97 evenly. 97 is prime.

Example 2: Is 561 prime?

561 looks like it might be prime, and it even passes some weaker tests (it is a Carmichael number). But trial division catches it:

  • 561 ÷ 3 = 187 (exact division)

561 is composite. Its prime factorization: 561 = 3 × 11 × 17. All divisors: 1, 3, 11, 17, 33, 51, 187, 561.

Example 3: Is 7919 prime?

The square root of 7919 is approximately 88.99. You would need to test all primes up to 88. None divide 7919 evenly. 7919 is prime — it is the 1000th prime number.

Example 4: Factorize 360

360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1.

Prime factorization: 360 = 2³ × 3² × 5. Divisor count: (3+1)(2+1)(1+1) = 24 divisors.

Primes From 1 to 100

There are 25 prime numbers between 1 and 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

The prime-counting function π(n) gives the number of primes up to n. π(10) = 4, π(100) = 25, π(1000) = 168, π(10000) = 1229. Primes become less frequent as numbers grow, but there are infinitely many — Euclid proved this around 300 BCE.

Why Prime Numbers Matter

Cryptography

RSA encryption relies on the difficulty of factoring the product of two large primes. A 2048-bit RSA key uses primes with roughly 300 digits each. Multiplying them is fast; reversing the product is computationally infeasible with current technology.

Number Theory

Primes are the building blocks of all integers. The Fundamental Theorem of Arithmetic states every integer greater than 1 has a unique prime factorization. This is why primes are sometimes called the "atoms" of mathematics.

Computer Science

Hash tables use prime-sized arrays to distribute keys evenly. Pseudorandom number generators use prime moduli. Error-correcting codes (like Reed-Solomon) rely on prime field arithmetic.

Key Facts

  • 2 is the only even prime
  • There are infinitely many primes (Euclid, ~300 BCE)
  • The largest known prime (2024) has over 41 million digits
  • Twin primes differ by 2 (e.g., 11 and 13)
  • Goldbach's conjecture: every even number > 2 is the sum of two primes (unproven)

Frequently Asked Questions

What is a prime number?

A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. For example, 7 is prime because it can only be divided evenly by 1 and 7. The number 6 is not prime because it is also divisible by 2 and 3.

Is 1 a prime number?

No. By definition, a prime number must have exactly two distinct positive divisors. The number 1 has only one divisor (itself), so it is neither prime nor composite. This convention keeps the Fundamental Theorem of Arithmetic (unique factorization) clean.

Is 2 a prime number?

Yes. 2 is the smallest prime number and the only even prime. Every other even number is divisible by 2, so no other even number can be prime.

How do you check if a large number is prime?

For small numbers (under a few billion), trial division works: test divisors from 2 up to the square root. For very large numbers, probabilistic tests like Miller-Rabin are used. They can say "almost certainly prime" with configurable confidence. Deterministic proofs for large numbers use algorithms like AKS or ECPP.

What is prime factorization?

Prime factorization breaks a composite number into the product of prime numbers. For example, 360 = 2³ × 3² × 5. Every positive integer greater than 1 has a unique prime factorization (Fundamental Theorem of Arithmetic). This tool shows the factorization visually for any composite number you enter.

What are the prime numbers from 1 to 100?

There are 25 primes: 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.

Why are prime numbers important in cryptography?

RSA encryption multiplies two large primes to create a public key. Breaking RSA requires factoring that product back into its primes, which is computationally infeasible for numbers with hundreds of digits. This asymmetry — easy to multiply, hard to factor — is the basis of public-key cryptography.

What is a Mersenne prime?

A Mersenne prime is a prime of the form 2^p − 1, where p is also prime. Examples: 3 (2²−1), 7 (2³−1), 31 (2⁵−1), 127 (2⁷−1). The largest known primes are almost always Mersenne primes because there is an efficient test (Lucas-Lehmer) specifically for this form.

What is the largest known prime number?

As of 2024, the largest known prime is 2^136,279,841 − 1, a Mersenne prime with over 41 million digits. It was discovered by the Great Internet Mersenne Prime Search (GIMPS) distributed computing project.

Does this tool store my data?

No. All calculations run entirely in your browser using JavaScript. No numbers are sent to any server. No inputs or results are stored or logged.

Related Tools

Privacy & Limitations

  • Client-side only. No data is sent to any server. No cookies, no tracking of inputs or results.
  • Integer input. This tool checks whole numbers. It does not test primality of decimal or negative values.
  • Browser precision. JavaScript integers are exact up to 2⁵³ − 1 (9,007,199,254,740,991). Numbers beyond this limit may produce incorrect results due to floating-point rounding.
  • Trial division. The algorithm is simple trial division, which is fast for numbers up to several billion. For very large numbers (hundreds of digits), specialized software and probabilistic tests are needed.

Related Tools

View all tools
Request a New Tool
Improve This Tool