Prime Number Generator
Generate prime numbers starting from a chosen point and see the next primes in the sequence, useful for practice, testing, and math curiosity.
Enter the Details
Result will appear here...
What this calculator does
This generates a set number of primes from the start of the sequence. Tell it how many you want, and it produces the first that many.
Enter a quantity, and the tool builds the list.
Using the calculator
- Enter how many primes you want.
- Press Calculate.
The result is the first that many prime numbers.
The first so many primes
Ask for 5 and you get 2, 3, 5, 7, 11, the first five primes. Ask for 10 and it carries the sequence further along. The tool always begins at 2, the smallest prime, and works upward, collecting primes one by one until it has the quantity you asked for.
A count, not a ceiling
The key here is that you are choosing a count, how many primes, rather than a ceiling. Whatever their size, you get exactly that many. That is the difference from the list of prime numbers tool, which instead returns every prime up to a value you set. Here you ask for "the first 10"; there you ask for "all below 100".
Primes go on forever
However many you ask for, the tool can always find them, because the primes never run out. Euclid proved more than two thousand years ago that there is no largest prime: the sequence continues without end, even as the gaps between one prime and the next tend to grow wider.
A worked example | the first 5 primes
Ask for the first 5 primes.
- The generator takes 2, then 3, skips 4 as composite, takes 5, skips 6, takes 7.
- It stops once five are gathered: 2, 3, 5, 7, 11.
So the first five primes are 2, 3, 5, 7, 11.
Questions people ask
What does this generate?
The first however many prime numbers you ask for, starting from 2.
What are the first 5 primes?
2, 3, 5, 7, and 11.
Is this a count or a limit?
A count. You choose how many primes, not how high to go.
Do primes ever end?
No. Euclid showed there is no largest prime, so the sequence is endless.
References
A note on the idea behind it. The generator returns the first chosen number of primes, starting at 2 and working upward. There are infinitely many primes, a fact proved by Euclid, so any requested count can always be met. For further reading, see Prime number.
- Generating the first several prime numbers in sequence from 2 upward.
- The infinitude of primes, established by Euclid, meaning there is no largest prime.
Okan Atalay is a results driven senior operations manager and a graduate of Industrial Engineering from Bilkent University. With over 22 years of experience in textile manufacturing and integrated operations, he has led large scale business process improvements and strategic planning initiatives. Currently, he serves as a top mathematics expert for a global ed tech platform, where he applies his analytical expertise to solve complex mathematical problems. At Eon Tools, he reviews converter and maths tools.
Other Tools
- Absolute Value Calculator
- Average Calculator
- Cube And Cube Root Calculator
- Cube Root Calculator
- Distributive Property Calculator
- Divide Into Two Parts
- Divisibility Test Calculator
- Factor Calculator
- Factorial Calculator
- Find Minimum And Maximum
- First N Digits Of E
- Full Screen Calculator
- Greatest Common Factor Calculator
- Integer Calculator
- Is It A Prime Number
- Least Common Multiple Calculator
- List Of Prime Numbers
- Long Division Calculator
- Long Multiplication Calculator
- Maths Calculator
- Modulo Calculator
- Multiplication Calculator
- Number Of Digits
- Prime Factor Calculator
- Prime Factorization Calculator
- Quotient And Remainder Calculator
- Radical Calculator
- Root Calculator
- Root Mean Square Calculator
- Rounding Numbers Calculator
- Scientific Notation Calculator
- Significant Figures Calculator
- Simplifying Radicals Calculator
- Sort Numbers
- Square Root Calculator
- Standard Form Calculator
- Summation (Sum) Calculator
- Weighted Average Calculator