Prime Number Generator

Generate the first N prime numbers.

  • Free to use
  • Accurate results
  • No registration required
  • Works on all devices
Enter a count to generate that many prime numbers, starting from 2.

Your result

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

Prime numbers

Largest prime generated29

AI explanation

Formula

Checks each successive integer for primality (trial division up to its square root) until the requested count is reached

Worked example

First 10 primes

Worked example: First 10 primes
FieldValue
How many primes10
Prime numbers2, 3, 5, 7, 11, 13, 17, 19, 23, 29
Largest prime generated29

Assumptions

  • Always starts from the first prime (2) — this generates the first N primes, not primes within a specific range.

Frequently asked questions

What is a prime number?

A whole number greater than 1 with exactly two factors — 1 and itself. 2 is the only even prime number.

How is a number checked for primality here?

By trial division — testing whether any number up to its square root divides it evenly. If none do, it's prime.

Can I generate primes within a specific range instead of just the first N?

Not on this page — it always starts from 2. Check the generated list and look for values within your target range if needed.

Related calculators

Report a calculation issue