1618.dev

small tools, one committed a day

Prime number checker

Is your number prime? Find out — and see its smallest factor, its prime neighbours, whether it's a twin prime, and which prime it is.

Loading Python…

What counts as prime

A prime is a whole number above 1 whose only divisors are 1 and itself (2, 3, 5, 7, 11, …). Everything else above 1 is composite — it has a smaller factor, which we show as proof. By convention 1 is neither prime nor composite, and 2 is the only even prime. A twin prime is a prime that sits just two away from another prime, like (11, 13) or (17, 19). We test primality by trial division up to √n, so even nine-digit numbers resolve instantly.