Skip to content

Prime Number Checker

Check whether a number is prime and see its prime factorization, divisors and the nearest primes.

Result

Enter your values and select Calculate to see the result.

Runs in your browser — nothing you enter is sent to a server.

How the Prime Number Checker works

Enter a whole number and the checker tells you whether it's prime — divisible only by 1 and itself. It also breaks the number into prime factors, counts its divisors and finds the nearest primes. Primality is decided with the Miller–Rabin test using 12 fixed bases, which is proven exact for numbers of this size, so even 16-digit numbers are answered at once. Factors are found by dividing by 2, 3 and then numbers of the form 6k ± 1. Results are exact for every whole number up to 9,007,199,254,740,991.

Formula

if n = p₁a × p₂b × …, divisors = (a + 1)(b + 1)…

Examples

360

360 = 2³ × 3² × 5, so it has (3 + 1)(2 + 1)(1 + 1) = 24 divisors. The nearest primes are 359 and 367.

2,147,483,647

This is prime — the Mersenne prime 2³¹ − 1, famous as the largest 32-bit signed integer.

Frequently asked questions

Is 1 a prime number?

No. A prime has exactly two divisors; 1 has only one.

Is 2 prime?

Yes — it's the only even prime.

Why the 16-digit limit?

Browsers store numbers exactly only up to 2⁵³ − 1. Beyond that, digits would be lost and the answer could be wrong.

GCD and LCM Calculator

Find the greatest common divisor and least common multiple of two or more numbers, with Euclid's steps.

Math Tools

Fraction Calculator

Add, subtract, multiply and divide fractions, with the answer simplified and shown as a mixed number and decimal.

Math Tools

Number Base Converter

Convert whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, of any size.

Converters