deftools.io Math & Data

Prime Number Checker

Check if a number is prime, find the next prime, factorize into prime factors, list all primes up to a limit, and more — live in your browser.

About this tool

A prime number is a whole number greater than 1 that can only be divided by 1 and itself — no other whole number divides it evenly. This tool helps you work with primes in five ways: check if any number up to 100 million is prime, break any number into its prime factors (e.g., 840 = 2³ × 3 × 5 × 7), list all primes in a range, find the nth prime, and find the next or previous prime from any starting point.

Prime factorization is useful for simplifying fractions, finding greatest common divisors, understanding RSA encryption, and solving number theory problems. The sieve-based primality check handles ranges efficiently up to 10 million.

FAQ

What is a prime number?

A prime is a whole number greater than 1 whose only positive divisors are 1 and itself. For example, 7 is prime because only 1 and 7 divide it evenly. 1 is not prime, and 2 is the only even prime.

How large of a number can I check?

The primality test works for any integer up to 100 million (100,000,000). Listing primes in a range works up to 10 million (10,000,000). The nth prime finder works up to n = 100,000 (the 100,000th prime is 1,299,709).

What is prime factorization used for?

Prime factorization breaks a composite number into its building-block primes. It is used in simplifying fractions, computing GCD and LCM, solving modular arithmetic problems, analyzing cryptographic key strength, and in many competitive programming and math contest problems.

How does the primality test work?

The tool uses trial division up to the square root of the number, optimized to check only 6k±1 candidates after testing divisibility by 2 and 3. This runs in O(√n) time — fast for numbers up to 100 million.

Related math & data tools

Copied!