Prime checker

Any size — a deterministic Miller–Rabin test answers 19-digit numbers instantly.

Try one
Primality
16 digits

9007199254740881

Prime

No divisors besides 1 and itself

Factorisation stopped early — this number is too large to factor by trial division, but the primality answer is exact.

ParityOdd
Digits16
Binary length53 bits
Digit sum74
Divisor countunknown
Sum of divisors
Previous prime9007199254740847
Next prime9007199254740997
VerdictPrime
Factors
Divisors2
Digits16

Prime Number Checker

Test whether an integer is prime with an exact deterministic check across the 64-bit range. Inspect its prime factorization when practical, divisor statistics, digit properties, and the nearest prime on either side.

Deterministic primality
< 2⁶⁴
Miller–Rabin test
M–R
Integer arithmetic
Exact
Nearest primes
±

Step by step

How to use it

  1. 01

    01Enter an integer

    Signs and grouping separators are accepted; primality applies to positive integers greater than one.

  2. 02

    02Read the verdict

    Prime means exactly two positive divisors. Composite means the number can be written as a product of smaller positive integers.

  3. 03

    03Inspect the factorization

    For manageable values, see each prime power and the resulting divisor count and sum.

  4. 04

    04Look at the neighbors

    Use the previous and next primes to understand the local gap or pick a nearby prime value.

Worked example

Why 221 is composite

Given

Integer
221
Square root
≈ 14.87

A divisor below the square root is enough

221 ÷ 13 = 17
221 = 13 × 17

divisors: 1, 13, 17, 221
Verdict
Composite
Prime factors
13 × 17
Divisor count
4

A composite number must have a factor no larger than its square root. Finding 13 settles the question without testing every number below 221.

Why this one

What a prime test proves

One is neither prime nor composite

A prime has exactly two positive divisors, while one has only itself. Keeping one separate preserves unique prime factorization.

Trial division is not the only test

Miller–Rabin uses modular exponentiation to reject composites quickly; a fixed witness set makes it deterministic for 64-bit inputs.

A primality answer can be easier than factoring

Tests can certify that a large integer is composite without cheaply revealing all of its factors.

Negative signs do not create negative primes

Standard elementary number theory defines primes among positive integers greater than one; factorization can still discuss the magnitude.

The judgement call

What should you inspect?

  • Need only a yes or no on a large 64-bit value

    Primality test

    Modular witnesses answer without enumerating factors.

  • Simplifying a fraction

    GCD

    Shared divisibility matters more than full factorization.

  • Counting all divisors

    Prime factors

    Exponents give the divisor count directly.

  • Cryptographic key generation

    Specialized audited library

    A browser utility is educational, not a secure key-generation workflow.

Reference

The numbers behind it

Prime
Exactly two positive divisors
Composite
Integer > 1 with more than two divisors
Divisor count
∏(exponent + 1)
Search bound
A composite has a factor ≤ √n

FAQ

Questions, answered plainly

Is 1 a prime number?

No. One has only one positive divisor, while a prime must have exactly two: 1 and itself.

Are negative numbers prime?

Under the standard definition, no. Primes are positive integers greater than one, though the magnitude of a negative integer has the same positive prime factors.

How does the checker test large numbers?

The prime number checker uses deterministic Miller–Rabin with a witness set proven sufficient for 64-bit integers, using exact modular arithmetic.

Why can factorization stop while the prime verdict is exact?

Primality testing and finding every factor are different computational tasks. The former can be fast even when trial division for the latter would take too long.

What is the next prime after a number?

It is the smallest prime greater than that number. The tool checks successive eligible integers with the same exact primality test.

Primality tests and factor calculations run locally. The integer is not uploaded.