Prime Gap Calculator

Enter a number to see its surrounding primes and the prime gap.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

A prime gap is simply the distance between one prime number and the next one along the number line. This calculator finds the largest prime below your chosen number and the smallest prime above it, then reports the gap between those two neighbors, letting you see how prime numbers thin out or cluster around any point you pick.

Prime gaps are famously irregular: the Prime Number Theorem tells us that on average, gaps near a number n grow roughly in proportion to the natural logarithm of n, so primes get sparser as numbers get bigger. But locally, gaps swing wildly — twin primes sit only 2 apart, while long stretches of consecutive composite numbers can create gaps of thousands. Whether every gap of size 2 recurs forever is the famous unsolved twin prime conjecture, and the general behavior of gaps is a major topic in analytic number theory and computational searches for record-sized gaps.

Students use tools like this to build intuition about prime distribution, and programmers and cryptographers use similar logic when picking candidate primes for keys, where knowing the neighborhood of primes around a starting point matters.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators