Size
The side length of the spiral, from 3 to 5,001. Even values round up to the next odd number, because a spiral needs a center cell. For example, 100 gives a 101 × 101 spiral showing the first 10,201 natural numbers.
Color
Pick a palette or set your own prime and composite colors. The two colors must differ, and strong contrast shows the patterns best. The arrows between them swap the colors.
Prime gap
Highlights only primes p where p - n or p + n is also prime. With a gap of 2, 19 is highlighted because 17 is prime, but 23 is not, because neither 21 nor 25 is prime.
The presets show twin (2), cousin (4) and sexy (6) primes. Custom accepts any even gap up to 1,000. Odd gaps aren't offered because an odd prime plus or minus an odd number is even, so the only prime it could equal is 2.
Density heatmap
Counts the highlighted primes in a square around each cell, including the cell itself. The radius (1 to 10) sets how far the square reaches. Cells with the most primes take the prime color, and cells with none take the composite color.
Exploring
Scroll or pinch to zoom, and drag to pan. Double-click zooms in, and Shift + double-click zooms out. With the preview focused, use + and - to zoom, the arrow keys to pan, and 0 to fit. Hover over or tap a cell to see its number. Zoom in far enough and the numbers appear on the cells.
Pins
Pin keeps the current version in the bar below the preview, so you can compare up to 6 and click one to restore it. Adding another replaces the oldest, and pins are cleared when you leave or reload the page.
Saving and sharing
Download PNG saves the full image, with one pixel per number. Copy link gives you a URL that reopens these exact settings. Everything is generated in your browser.