Primes in Range Calculator
Enter a start and end number to list every prime number in that range.
Result
How it is calculated
The tool walks through every whole number from start to end, both included, and tests each one by trial division: numbers below 2 are rejected, even numbers above 2 are rejected, and an odd number n is divided by 3, 5, 7, … while i × i ≤ n. Those that survive are listed in ascending order, followed by their count. Both ends must be whole numbers, the start cannot be negative, the end cannot be below the start, and the span end − start may not exceed 1 000 000; otherwise there is no result. A range with no primes is not an error: it shows an empty list and a count of 0.
Worked example
List the primes from 90 to 120. Step 1: even numbers are out, leaving the odd ones 91 to 119. Step 2: remove multiples of 3, 5, 7: for example 91 = 7 × 13, 93 = 3 × 31, 95 = 5 × 19, 99 = 9 × 11, 105, 111, 115, 117 and 119 = 7 × 17 all fail. Step 3: the numbers that remain are prime. The tool prints 97, 101, 103, 107, 109, 113, a count of 6.
Common mistakes
- Expecting the endpoints to be excluded. Start and end are both tested, so a range from 7 to 7 returns 7.
- Entering the end before the start. A reversed range returns no result rather than swapping the values.
- Treating 1 as a prime or 2 as a non-prime. The tool counts 2 as prime, the only even one, and never counts 1.
- Entering a decimal or a range wider than a million numbers and expecting a list; such inputs are refused.
- Reading an empty list as an error. Ranges such as 24 to 28 simply contain no primes.
About this calculator
Finding every prime number in a given range means checking each integer from the start value to the end value and determining whether it has any divisors other than 1 and itself — this calculator tests each number by trial division, checking odd divisors only up to its square root. Large-scale tools often use the Sieve of Eratosthenes instead, an ancient algorithm that eliminates multiples of each prime as it goes rather than testing every number individually, making it far faster for very large ranges.
Students in number theory and discrete math courses use prime-range listings to explore how prime density thins out as numbers grow larger, a pattern described by the prime number theorem, while programmers and computer science students use the same kind of range-based prime generation to test and benchmark sieve algorithms, and cryptography courses reference prime generation as the conceptual starting point for how large primes get selected in RSA key generation.
This calculator takes a starting and ending number and lists every prime found in that range, along with a count of how many there are. The end number can be at most 1,000,000 above the start number.
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