Prime Number Checker
Check primality and list primes up to a limit.
- Is 97 prime?
- Yes
Prime Number Checker tests whether a whole number is prime using trial division, and can optionally list every prime up to that number with a sieve of Eratosthenes. Both operations run instantly and locally in your browser.
How it works
Enter a whole number and the tool checks divisibility by 2 and odd numbers up to its square root to determine primality, reporting the smallest factor when the number is composite. Enable the list option to generate every prime up to a capped limit.
Benefits
- Checks primality using efficient trial division
- Shows the smallest factor for composite numbers
- Can list every prime up to a chosen limit
- Runs instantly without uploading any numbers
Use cases
- Verify a number for a math assignment or puzzle
- Generate a list of primes for a cryptography exercise
- Explore factorization of composite numbers
- Check large candidate numbers quickly and privately
Best practices
- Use the list feature only when you need every prime, not just one check
- Keep list limits reasonable to avoid a very long output
- Remember 0, 1, and negative numbers are never prime
- Use single-number checks for very large candidates
Common mistakes
- Assuming 1 is a prime number
- Forgetting that even numbers other than 2 are never prime
- Requesting a prime list for a number far beyond the cap
- Expecting instant results for extremely large numbers
Privacy
All primality testing and sieve generation happen locally in your browser. Prime Number Checker does not transmit or store the numbers you enter.
Frequently asked questions
- How does the tool check whether a number is prime?
- It uses trial division: the number is tested for divisibility by 2 and then every odd number up to its square root. If nothing divides it evenly, it is prime.
- What counts as a prime number?
- A prime number is a whole number greater than 1 with no positive divisors other than 1 and itself. Numbers like 0, 1, and negative numbers are never prime.
- What does "smallest factor" mean for a non-prime number?
- For composite numbers, the tool shows the smallest number greater than 1 that divides evenly into it—for example, 91's smallest factor is 7 (91 = 7 × 13).
- Why is the list of primes capped at 100,000?
- Listing primes uses a sieve of Eratosthenes, which needs memory proportional to the upper bound. Capping the list at 100,000 keeps the browser responsive.
- How large a number can I check for primality?
- Single-number checks work up to 1,000,000,000,000 while staying fast. Beyond that, trial division becomes too slow for instant browser results.
- Does this tool send my numbers anywhere?
- No. All primality checks and sieve calculations run locally in your browser using plain JavaScript.
Related tools
Statistics Calculator
math
Count, mean, median, mode, and stdev from a list.
- statistics
- mean
- median
- calculator
Aspect Ratio Calculator
math
Simplify a ratio and scale to a target dimension.
- aspect-ratio
- resize
- calculator
- math
GPA Calculator
math
Weighted 4.0-scale GPA from grades and credits.
- gpa
- grades
- calculator
- education
Age Calculator
math
Age in years, months, and days between two dates.
- age
- date
- calculator
- math
Percentage Calculator
math
Percent of, percent-of-total, and percent change.
- percentage
- percent-change
- calculator
- math
BMI Calculator
math
BMI and weight category in metric or imperial.
- bmi
- health
- calculator
- fitness