Primes

Prime sieve in a range, Miller–Rabin primality test, and find the next prime after n (BigInt).

About this tool

Choose a primality test, the next prime strictly greater than n, or a range list. Integers remain exact; blanks are rejected. Integers below 2 are neither prime nor composite. The common prime test is deterministic below 318665857834031151167461; larger passing candidates are explicitly only probable primes.

Next-prime search preserves the entered n and qualifies probable results beyond the proven bound. Larger work runs in a cancellable browser worker with a 15-second deadline and a bounded candidate search. Range bounds satisfy1≤from≤to≤5,000,000. Lists show 200 numbers per page; CSV contains the full result.

Single-number limit: 512 characters, signed decimal or 0x/0b/0o notation. Small inputs update directly: tests up to 10¹², next-prime searches up to 10⁶ and ranges ending at 10,000. Enter updates immediately. Larger work is explicitly started in the cancellable worker. Only raw inputs and the selected task are kept locally, including invalid drafts. Results and pages are recalculated; the list scrolls locally.