Nth Prime Number Calculator
Find the nth prime number.
Result
How it is calculated
A prime is a whole number greater than 1 whose only divisors are 1 and itself. To find the n-th prime the tool starts at 2 and checks each following integer by trial division: a number is prime if no integer from 2 up to its square root divides it evenly. Every prime found increases a counter, and the search stops when the counter reaches n. The position n is cut to a whole number and must be between 1 and 20,000; anything outside that range returns no result. Counting starts at 1, so n = 1 gives 2, n = 2 gives 3 and n = 3 gives 5. The result is the prime itself, not its position.
Worked example
Ask for n = 100. The list begins 2, 3, 5, 7, 11, 13 and continues, skipping every number that has a divisor other than 1 and itself. When the tool has counted 100 primes it stops at the last one, so the 100th prime is 541. The next one after it, 547, would be the 101st.
Common mistakes
- Counting 1 as a prime; the first prime is 2.
- Mixing up the position with the value: n = 100 asks for the 100th prime, not whether 100 is prime.
- Using a zero-based index as programmers do; here the first prime is n = 1, not n = 0.
- Entering a number above 20,000, which the tool does not accept.
- Entering a decimal such as 10.7 and expecting rounding; the fraction is simply dropped.
About this calculator
This calculator finds the nth prime number — for example, the 1st prime is 2, the 2nd is 3, the 10th is 29, and so on — by sieving or testing successive integers for divisibility until it has counted enough primes. Prime numbers are whole numbers greater than 1 with exactly two divisors: 1 and themselves.
Math students use it to check number-theory homework, and programmers use it to verify their own prime-generating algorithms against a known answer.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments