The Top-20 Prime Gaps
Last updated: 31 December 2022

Prime Gaps

References: Mainpage Prime Gap Project & Mainthread on mersenneforum.org

Note: Original page was created by Jens Kruse Andersen (2005 - 2019).
This page is developed and maintained by Norman Luhn (since Oct 2021). Contact: pzktupel[at]pzktupel[dot]de.


Record tables

    Record prime gaps (no known gap larger with smaller start)

    Largest known prime gaps

    • more than 1 million
    • between 900000 to 999999
    • between 800000 to 899999
    • between 700000 to 799999
    • between 600000 to 699999
    • between 500000 to 599999
    • between 400000 to 499999
    • between 300000 to 399999

    Largest known prime gaps with proven primes as endpoints

    Largest known prime gaps with merit 40..50
    Top-1000 largest known prime gaps with merit 30..40
    Top-1000 largest known prime gaps with merit 20..30
    Top-1000 largest known prime gaps with merit 10..20


Definitions for this site:
There is a prime gap with positive integers p1 and p2 as end points, if p1 < p2 are consecutive primes (all intermediate numbers are composites). Some people define p1+1 and p2-1 to be the end points.
The size of the prime gap is p2 - p1. Some people define it to be one less.
The merit of the prime gap is size / ln p1, where ln is the natural logarithm. Some people use  p2 or a number between p1 and p2, but the difference is microscopic for large primes.

This site requires that all numbers inside a listed prime gap have been proved to be composite, but the end points are not required to be proven primes. If they are not proven then they must be probable primes, also called PRP's. Specifically they must have passed at least 5 Miller-Rabin tests or Fermat PRP tests with different bases, or stronger PRP tests.
A PRP can loosely speaking be considered "almost certainly" prime, based on statistical properties of PRP tests, but there is a small risk that a PRP is actually composite (very small for large PRP's or many PRP tests). In that case, the gap listed here would just be part of an even larger prime gap which would still qualify for the tables, possibly at a better position. PRP's are accepted here and on some other prime gap pages for this reason, although PRP's are often not accepted in other contexts, e.g. lists of the largest known primes.
Proven primes are preferred here when practical, but prime gap searches usually produce PRP's which are not easily provable when the PRP is large. If the whole top-20 table with merit above 10 or 20 is PRP's then the single largest gap with proven end points is added without rank.

The average prime gap near an integer N is approximately ln N. The merit indicates the relative size of a prime gap, compared to the approximate average for that size primes. This site only accepts prime gaps with merit above 10.0 (and so, in a loose sense, the gap must be at least 10 times larger than is typical). At the opposite end, the smallest known merit as of 2011 is achieved for the largest known twin prime, 3756801695685*2^666669+/-1 with 200700 digits and merit 0.000004328, found by Timothy D. Winslow, PrimeGrid, TwinGen, LLR.

Thomas R. Nicely has composed tables of First occurrence prime gaps and first known occurrence prime gaps. These tables include most or all prime gaps in the tables below, and many more. He uses the same definitions and his tables may sometimes be more up to date than mine.

Please mail me with new candidates for the tables, or corrections if you think there are errors. Indicate whether the end points are proven primes and give a simple expression if possible. When multiple gaps are submitted, Nicely's format is preferred. I will strive to update within 2 days of receiving a submission. If a gap is only submitted to Nicely then it should eventually turn up here but it may take a while.

The person running a program is credited as discoverer. If a specialized prime gap program is used then the programmer is listed afterwards, when known. A general program (not designed for large prime gaps) such as a sieve, PRP tester or primality prover is usually not mentioned. The original top-20 page and Nicely's site do not mention these programs and this site follows what might be called the prime gap practice.
For the record: All gaps involving me (Jens K. Andersen) used my own sieve and either the GMP library (usually below 1100 digits) or PrimeForm/GW for PRP testing. Marcel Martin's Primo proved all proven end points, except the gap of 337446 with 7996-digit primes which were proved by François Morain with fastECPP.

In 1931 E. Westzynthius proved there are arbitrarily large merits, i.e. for any m there exist gaps with merit > m.
A rough heuristical estimate which may deteriorate for large m indicates around 1 in em prime gaps has merit > m. e10 ~= 20000, e20 ~= 5·108, e30 ~= 1013. It is possible to greatly increase these odds in gap searches among carefully selected large numbers, by using modular equations to ensure unusually many numbers with a small factor. Unfortunately the best methods produce numbers with no simple expression.
There are usually only few prime gaps with simple expressions for the end points among the 20 largest gaps for any merit. However, the single largest gap with "basic" expression and merit above 10 or 20 is listed in those tables, without rank if outside the top-20. A basic expression is here defined as maximum 25 characters, all taken from 0123456789+-*/^( ). Primorial and factorial are not allowed since they can be used to ensure many small factors, and the idea of the basic expression record is partly to avoid special prime gap methods.

Big decimal expansions are in a separate file, or will be available by e-mail request. P838 means 838-digit end points which are proven primes. PRP43429 means one or two PRP end points with 43429 digits. The digit count is for the gap start p1 if there is a difference. n# (called n primorial) is the product of all primes ≤ n, e.g. 7# = 2 · 3 · 5 · 7.


Chris Caldwell's Prime Pages, The Gaps Between Primes: http://primes.utm.edu/notes/gaps.html
Eric Weisstein's Mathworld, Prime Gaps: http://mathworld.wolfram.com/PrimeGaps.html
Tomás Oliveira e Silva's Gaps between consecutive primes: http://www.ieeta.pt/~tos/gaps.html
Wikipedia's Prime gap: http://en.wikipedia.org/wiki/Prime_gap
Jens Kruse Andersen's
     First known prime megagap: http://primerecords.dk/primegaps/megagap.htm
     Largest known prime gap: http://primerecords.dk/primegaps/megagap2.htm
     A proven prime gap of 337446: http://primerecords.dk/primegaps/gap337446.htm
     New largest known prime gap: http://primerecords.dk/primegaps/megagap3.htm
     A megagap with merit 25.9: http://primerecords.dk/primegaps/gap1113106.htm
Carlos Rivera's The Prime Puzzles & Problem Connection: Problem 46 . Holes and Crowds-I
William V. Wright's Cramer's conjecture: http://wvwright.net

This page is based on an original page by Paul Leyland using partially different notation.