Prime number test
Test possible divisors through the square root to determine whether an integer is divisible only by 1 and itself.
2 ≤ d ≤ √n
Test primality, find prime factors, list primes in a range, and calculate neighboring prime numbers.
Version 1.0 · Last Updated: August 11, 2026 · Maintained by ToolLarder
Test one number, factor it into primes, or list primes in a selected interval with a segmented sieve. Neighbor tools find the next, previous, or equally close prime numbers.
Test possible divisors through the square root to determine whether an integer is divisible only by 1 and itself.
2 ≤ d ≤ √n
Divide by the smallest prime factors and count the exponent of each factor.
n = p₁ᵃ¹ × p₂ᵃ² × …
List all primes including the interval endpoints efficiently with a segmented sieve.
prime ∈ [start, end]
Find the first prime strictly greater than the entered number.
min(p > n)
Find the greatest prime strictly less than the entered number.
max(p < n)
Compare lower and upper prime distances and return both primes when the distances are equal.
min |p−n|