Experimental

Prime Gap Finder

Find the gaps between consecutive prime numbers up to a limit, and identify the largest gap and the twin primes with a gap of two.

Last reviewed by the Radiatus Cloud team

Find the gaps between consecutive primes and the largest gap.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

Explore prime gaps

A prime gap is the difference between two consecutive prime numbers. This tool finds all the primes up to your limit, computes the gap after each one, and reports the largest gap, the average gap, and the number of twin prime pairs, which are primes separated by a gap of just two. Gaps start small among the early primes but grow larger and more irregular as numbers increase, revealing the unpredictable spacing of the primes.

For example, between primes up to two hundred the gaps vary widely, and several twin pairs appear.

The mystery of prime spacing

The distribution of prime gaps is a deep and partly unsolved area of number theory. While gaps tend to grow on average as numbers get larger, they do so irregularly, and twin primes keep appearing even among very large numbers, though whether infinitely many twin primes exist remains unproven. Studying the gaps is a window into the surprising structure, and apparent randomness, of the primes.

The tool uses an efficient sieve to find the primes, then simply differences consecutive values to reveal the gaps. All calculation happens locally in your browser.

Related tools

Frequently Asked Questions

What is a prime gap?

It is the difference between two consecutive prime numbers, such as the gap of two between eleven and thirteen.

What are twin primes?

Pairs of primes that differ by exactly two, such as eleven and thirteen. The tool counts how many appear up to your limit.

Do prime gaps keep growing?

On average they grow as numbers increase, but irregularly, and small gaps including twin primes keep appearing among large numbers.

Is the twin prime question solved?

No. Whether there are infinitely many twin primes is a famous unsolved problem, though much progress has been made.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Enter an upper limit to analyse the prime gaps below it.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.