Prime Number Checker

Updated July 2026

Enter a positive whole number to find out instantly whether it is prime or composite. If it is composite you also get the full prime factorization; if it is prime you get the next and previous prime. Everything runs privately in your browser.

A prime number is a whole number greater than 1 that is divisible only by 1 and itself. For example, 7 is prime, while 8 is composite because it can be divided by 2 and 4. The number 1 is neither prime nor composite.
Enter a positive integer. Values above 10^15 use a probabilistic test.
Result
Prime factorization
Number of divisors
Previous prime
Next prime
All divisors

How this prime number checker works

A prime number is a whole number greater than 1 that has exactly two positive divisors: 1 and itself. Numbers greater than 1 that are not prime are called composite — they can be broken down into a product of smaller factors. The numbers 0 and 1 are special cases: neither is prime, and 1 is not composite either.

To decide whether a number n is prime, this tool uses trial division up to the square root of n. If no integer from 2 up to √n divides n evenly, then n is prime. Testing only up to the square root is enough, because any factor larger than √n must pair with a factor smaller than √n that has already been checked. For very large inputs (above 1015) the tool switches to a fast Miller–Rabin probabilistic test to keep results instant.

Worked example: 17 is prime — testing 2, 3 and 4 (since √17 ≈ 4.12) finds no divisor. By contrast 360 is composite, and its prime factorization is 2³ × 3² × 5 (that is, 8 × 9 × 5 = 360).

Reference — the primes up to 50 are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47.

Frequently asked questions

What is a prime number?
A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. For example, 7 is prime because nothing between 2 and 6 divides it evenly, while 8 is composite because it is divisible by 2 and 4.
Is 1 a prime number?
No. The number 1 is neither prime nor composite. A prime must have exactly two distinct positive divisors, but 1 has only one divisor (itself), so by definition it is excluded.
Is 2 a prime number?
Yes. 2 is the smallest prime and the only even prime, because its only divisors are 1 and 2. Every other even number is divisible by 2 and is therefore composite.
What is prime factorization?
Prime factorization is writing a number as a product of prime numbers. For example, 360 = 2 × 2 × 2 × 3 × 3 × 5, usually written with exponents as 2³ × 3² × 5. Every integer greater than 1 has a unique prime factorization.
How do you check if a number is prime?
Try dividing the number by every integer from 2 up to its square root. If none divide it evenly, the number is prime. You only need to test up to the square root because any larger factor would pair with a smaller one already checked.
What is the largest known prime number?
As of 2024 the largest known prime is 2136279841 − 1, a Mersenne prime with 41,024,320 digits found by the GIMPS project. There are infinitely many primes, so there is no single largest prime overall — only the largest one discovered so far.
⚡ Prime Number Checker — by larely ↗

Related tools

Circle Calculator

Find a circle's radius, diameter, circumference and area from any one value.

Permutation & Combination Calculator

Calculate combinations and permutations for n and r.

Logarithm Calculator

Compute log of any base, plus log10, ln and log2, with change of base.

Factorial Calculator

Calculate n! exactly for any non-negative integer, including huge values.

Fibonacci Calculator

Generate the Fibonacci sequence and find the Nth Fibonacci number.

Molarity Calculator

Solve molarity = moles / liters, including from mass and molar mass.

Modulo Calculator

Calculate a mod n with quotient, remainder and negative-number handling.

Percent Error Calculator

Calculate percent error between an experimental and a true value.

Z-Score Calculator

Find a z-score and its percentile from a value, mean and standard deviation.

Cylinder Volume Calculator

Find a cylinder's volume, surface area and capacity in liters or gallons.

Half-Life Calculator

Calculate remaining quantity, decay constant and half-lives elapsed.

Percent Yield Calculator

Calculate reaction percent yield from actual and theoretical yield.

Browse all 251 free tools →