Skip to content

Nth Prime Number Calculator

    Enter a position, and the calculator will return the exact prime number at that place in the ordered prime sequence. For example, the 1st prime is 2, the 10th prime is 29, and the 100th prime is 541.


    Result will appear here.

    For smooth browser use, this on-page tool accepts positions from 1 to 100,000. Positions start at 1, not 0.

    What the nth prime number means

    The nth prime number is the prime number found at position n when all prime numbers are written in order. Mathematicians usually write it as pn.

    Quick answer: an nth prime calculator does not test whether n itself is prime. It finds the prime number sitting in the nth position of the prime sequence.

    The prime sequence begins like this:

    2, 3, 5, 7, 11, 13, 17, 19, 23, 29…

    So the 1st prime is 2, the 2nd prime is 3, the 3rd prime is 5, and the 10th prime is 29. The position matters. That is why “the 10th prime” and “is 10 prime?” are two different questions.

    How the calculator finds the nth prime

    A calculator like this works by generating prime numbers in order and stopping when it reaches the requested position. It checks each candidate number and keeps only values that have exactly two positive divisors: 1 and itself.

    The basic method

    The process is simple, but it needs care:

    • Start with 2, the first and only even prime.
    • Test only odd numbers after that, because every larger even number is divisible by 2.
    • For each candidate, test divisibility only up to its square root.
    • Keep the candidate if no smaller prime divides it.
    • Stop when the list reaches position n.

    Why square root is enough: if a number has a factor larger than its square root, it must also have a matching factor smaller than its square root. If no smaller factor exists, the number is prime.

    Examples of nth prime numbers

    Common nth prime values
    Position nnth prime pnMeaning
    12The first prime number
    23The second prime number
    1029The 10th number in the prime sequence
    2597The 25th prime number
    100541The 100th prime number
    1,0007,919The 1,000th prime number
    10,000104,729The 10,000th prime number

    Why there is no simple formula for the nth prime

    Prime numbers become less regular as they grow. There are patterns in their average behavior, but there is no simple school-style formula that gives the exact nth prime for every position without checking or generating primes.

    Number theory does give useful estimates. For large values of n, the nth prime is near n(ln n + ln ln n). This comes from the prime number theorem. It helps predict the rough size of pn, but it is not an exact replacement for calculation.

    Important distinction: an estimate can tell you where the nth prime may be located. An nth prime calculator gives the actual value.

    Nth prime vs prime checking

    These two tasks are related, but they answer different questions.

    • Nth prime: “What prime is at position 500?”
    • Prime checking: “Is 500 a prime number?”

    If you already have a number and want to test it directly, use the Prime Number Checker. If you need the prime at a certain position, use this nth prime calculator.

    Why nth primes matter

    Nth prime values are not just list entries. They help connect several ideas in prime number study: prime order, prime gaps, factor testing, sequence growth, and distribution of primes.

    They show how primes thin out

    The 10th prime is 29, but the 10,000th prime is 104,729. This jump shows a basic feature of prime numbers: primes continue forever, yet they become more spread out on average as numbers grow.

    They help compare exact values with estimates

    When students learn the prime number theorem, nth primes make the idea concrete. You can compare an estimated position with the exact value returned by a calculator. That makes the topic easier to test and easier to remember.

    They are useful in computation

    Programming tasks often use nth primes to test loops, divisor checks, sieves, and sequence logic. The first few thousand primes are also useful in factorization practice, modular arithmetic examples, and small cryptography lessons.

    Common mistakes

    Mistake 1: treating n as the prime being tested

    If you enter 100, the calculator returns the 100th prime, which is 541. It is not asking whether 100 is prime.

    Mistake 2: starting the count at zero

    Prime positions start at 1. There is no 0th prime number. The first prime is 2.

    Mistake 3: counting 1 as prime

    The number 1 is not prime because it has only one positive divisor. A prime number must have exactly two positive divisors. This is why the prime sequence starts with 2, not 1.

    How to read the result

    When the calculator returns a number, read it as a position statement. If the result says the 1,000th prime is 7,919, that means there are exactly 1,000 prime numbers from 2 through 7,919, including 7,919 itself.

    This is a clean way to think about prime order. It also helps when comparing primes with nearby composite numbers. For example, 7,918 is not prime because it is even, but 7,919 holds a precise place in the prime sequence.

    FAQ

    What is the nth prime number?

    The nth prime number is the prime found at position n in the ordered list of primes. The 1st prime is 2, the 2nd prime is 3, the 3rd prime is 5, and so on.

    What is the 100th prime number?

    The 100th prime number is 541. That means 541 is the 100th value in the prime sequence.

    Is there a formula for the nth prime?

    There are estimates for the size of the nth prime, but there is no simple exact formula used in normal calculation. Exact results usually come from generating or testing prime candidates.

    Why is 1 not the first prime?

    Prime numbers must have exactly two positive divisors. The number 1 has only one positive divisor, so it is not prime. The first prime is 2.

    What is the difference between nth prime and prime checking?

    Nth prime calculation finds the prime at a given position. Prime checking tests whether a specific number is prime.