Prime Number Checker

Use the Prime Number Checker to determine whether a nonnegative whole number is prime, composite, or below the prime-number range. The result is exact for every accepted value through 18,446,744,073,709,551,615, and a small factor is shown for composite values when one is quickly available.

Method reviewed by the NumUtility editorial team · Updated August 25, 2026

Check whether a number is prime

Supports nonnegative integers through the unsigned 64-bit limit.
Result97 is primeIts only positive factors are 1 and itself.

How to use this prime number checker

Enter one nonnegative whole number without commas, spaces, signs, or decimal points. The result updates immediately. Values from zero through the unsigned 64-bit maximum are supported. Remember that 0 and 1 are neither prime nor composite under the standard definition.

How the calculation works

A prime number is a whole number greater than 1 with exactly two positive factors: 1 and itself. A composite number is greater than 1 and has at least one additional factor. The number 2 is the only even prime; every other even number greater than 2 is composite.

Trying every possible divisor is unnecessary for large inputs. This checker first handles small prime factors, then uses deterministic Miller–Rabin witnesses proven sufficient across the accepted 64-bit range. Modular exponentiation keeps the test fast without converting the integer to an imprecise floating-point number.

Formulas

Prime definition

n is prime when n > 1 and its only positive divisors are 1 and n

Trial-division boundary

If n is composite, it has a factor no greater than √n

Miller–Rabin decomposition

n − 1 = d × 2^s, where d is odd

Worked examples

Check 97

No positive integer from 2 through √97 divides 97, so its only positive factors are 1 and 97. Therefore, 97 is prime.

Check 91

91 = 7 × 13, so it has factors other than 1 and itself and is composite.

Common uses

Number theory practice

Check examples while learning primes, composites, factor pairs, divisibility, and prime factorization. Use the result to verify hand work rather than skipping the reasoning.

Fractions and divisibility

Identify numbers with no nontrivial positive factors and explore when two values may be relatively prime. A prime result does not by itself establish the GCF of a larger set.

Programming and test data

Verify integer examples within the documented 64-bit range. Cryptographic systems require specialized libraries, much larger parameters, and audited prime-generation procedures.

Accuracy and limitations

The test uses exact BigInt modular arithmetic and a deterministic Miller–Rabin witness set for every accepted unsigned 64-bit integer. It does not rely on JavaScript floating-point conversion.

The optional factor search is intentionally limited and may not display a factor for a large composite even though compositeness is proven. This educational checker is not a cryptographic prime generator or factorization service.

Frequently asked questions

Is 1 a prime number?

No. A prime must have exactly two positive factors. The number 1 has only one positive factor, so it is neither prime nor composite.

Is 2 prime?

Yes. Its positive factors are 1 and 2, making it the smallest prime and the only even prime.

Are negative numbers prime?

Standard elementary number theory defines primes as positive integers greater than 1. This checker therefore accepts nonnegative inputs only.

How large a number can I check?

The accepted maximum is 18,446,744,073,709,551,615, the largest unsigned 64-bit integer. The test is deterministic throughout that range.

Why is a factor not always displayed for a composite?

Primality testing can prove compositeness much faster than complete factorization. The checker searches for a small illustrative factor but does not claim to factor every large composite.

Is the prime number checker free to use?

Yes. NumUtility is free, requires no account, and places no limit on ordinary calculations.

Are my entries stored?

No. The calculation runs in your browser. Values entered into the tool are not sent to NumUtility or saved by us.

Related calculators

Related guides