Free Prime Number Calculator Online
Check if any number is prime or composite, get its prime factorization with step-by-step working, or generate a list of prime numbers in any range โ all in one free tool.
- Enter a number above and click Calculate to see the working.
Your Complete Free Prime Number Calculator Online
This free prime number calculator does three things in one tool: checks whether any number is prime or composite, finds the complete prime factorization with step-by-step division working, and generates a full list of prime numbers in any range using the Sieve of Eratosthenes. No downloads, no login, works instantly in your browser.
Enter any positive integer and instantly find out if it is prime or composite. The calculator uses trial division up to โn to test divisibility. Displays all factors, factor count, and detailed step-by-step working so you can learn the method.
Find the complete prime factorization of any composite number โ expressed as a product of primes (e.g. 360 = 2ยณ ร 3ยฒ ร 5). Shows each division step and the final exponential form. The essential prime number factor calculator for math homework.
Generate all prime numbers in any range โ from 1 to 100, 1 to 1000, or any custom range up to 10,000 numbers. Uses the ancient Sieve of Eratosthenes algorithm, which is far faster than checking each number individually.
Every calculation includes a numbered step-by-step explanation: which primes were tested, which divide evenly, and why the final verdict is prime or composite. Perfect for students learning how to figure prime numbers by hand.
The primality checker handles integers up to 10 trillion (10,000,000,000,000). For the factorization mode, any composite number up to billions can be factored. The algorithm is optimized to skip even divisors after checking 2.
Everything runs in your browser. No data is uploaded to any server. Works on desktop, tablet, and mobile. Use it for school homework, math competitions, programming projects, or cryptography research โ all at zero cost.
How to Use This Free Prime Number Calculator
Three modes โ three simple workflows. Pick the tab that matches what you need and get your answer in seconds.
- Select the Is it Prime? tab (it's selected by default)
- Type any positive integer into the input field โ e.g. 97
- Click Check / Calculate
- Read the verdict: "97 is PRIME" or "100 is COMPOSITE"
- See all divisors listed, plus the step-by-step divisibility test
- Click the Factorization tab
- Enter the number you want to factorize โ e.g. 360
- Click Check / Calculate
- Read the factorization: 360 = 2ยณ ร 3ยฒ ร 5
- Follow each division step in the working panel below
- Click the Prime List tab
- Enter your From and To range โ e.g. 1 to 100
- Or use a preset button (1โ50, 1โ100, 1โ1000โฆ)
- Click Check / Calculate
- See every prime number in your range displayed as a clickable grid
Why Use This Free Prime Number Calculator Online?
More than just a yes/no prime checker โ this tool teaches the math behind every answer with full working, supports all three core use cases, and runs entirely in your browser.
The result card turns green for PRIME and indigo for COMPOSITE โ you see the answer at a glance before reading a single line. Clear, unambiguous, and satisfying to use in classroom demonstrations.
The step panel shows every divisor tested, the trial division logic up to โn, and exactly why a number passes or fails each test. Students learning how to figure prime numbers can follow the exact same process by hand.
The prime number factor calculator displays results both in linear form (2 ร 2 ร 3 ร 5) and in exponential form (2ยฒ ร 3 ร 5) โ exactly how math textbooks and exams expect answers to be presented.
The Prime List mode uses the classic Sieve of Eratosthenes โ the most efficient algorithm for generating all primes in a range. It eliminates multiples of each prime sequentially, handling ranges up to 10,000 numbers in milliseconds.
For composite numbers, all factors (divisors) are listed โ not just prime factors. For example, 12 shows factors 1, 2, 3, 4, 6, 12. This makes it easy to use as a divisibility checker and factor-finding tool alongside the primality test.
All calculations run in JavaScript โ no server round-trips, no waiting. Works on any device without an internet connection after first load. Perfect for students in low-bandwidth environments or exam preparation without internet access.
Prime Numbers 1โ100 & Divisibility Rules
Use these reference tables alongside the calculator. The first 25 prime numbers are the building blocks you need to manually check primality for numbers up to 625 (25ยฒ = 625).
There are 25 prime numbers between 1 and 100.
Quick Divisibility Rules โ How to Figure Prime Numbers
| Divisor | Rule | Example |
|---|---|---|
| 2 | Last digit is even (0, 2, 4, 6, 8) | 148 โ last digit 8 โ divisible by 2 โ |
| 3 | Sum of digits is divisible by 3 | 123 โ 1+2+3=6 โ divisible by 3 โ |
| 5 | Last digit is 0 or 5 | 125 โ last digit 5 โ divisible by 5 โ |
| 7 | Double the last digit, subtract from rest. Result divisible by 7. | 161: 16โ(2ร1)=14. 14รท7=2 โ |
| 11 | Alternating sum of digits divisible by 11 (or 0) | 121: 1โ2+1=0 โ divisible by 11 โ |
| 13 | Add 4ร the last digit to the rest. Repeat until small. | 91: 9+(4ร1)=13 โ divisible by 13 โ |
- Exactly 2 factors: 1 and itself
- Cannot be formed by multiplying two smaller natural numbers
- Only one prime is even: 2
- All primes > 3 are of the form 6k ยฑ 1
- Examples: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29โฆ
- Infinite in number (proved by Euclid, ~300 BC)
- 3 or more factors
- Can always be expressed as a product of primes (Fundamental Theorem of Arithmetic)
- Every even number > 2 is composite
- Smallest composite: 4 = 2 ร 2
- Examples: 4, 6, 8, 9, 10, 12, 14, 15, 16, 18โฆ
- Prime factorization is unique for every composite number
- The number 1 is neither prime nor composite
- It has only one factor (itself)
- Including 1 as prime would break the Fundamental Theorem of Arithmetic (unique factorization)
- Mathematicians excluded 1 from primes in the 19th century
- 2 is the only even prime and the smallest prime
What Is a Prime Number?
A prime number is a natural number greater than 1 that has exactly two distinct factors: 1 and itself. In other words, a prime number cannot be formed by multiplying two smaller natural numbers โ it is mathematically indivisible (other than by 1 and itself). The study of prime numbers is one of the oldest and most active areas of mathematics, underpinning modern cryptography, computer science, and number theory.
Key facts about prime numbers:
- The number 1 is NOT prime โ it has only one factor (itself). Prime numbers must have exactly two factors.
- 2 is the only even prime number โ all other even numbers are divisible by 2, giving them a third factor.
- All primes greater than 3 are of the form 6k ยฑ 1 (though not all numbers of this form are prime).
- There are infinitely many prime numbers โ proved by Euclid around 300 BC using a simple elegant proof by contradiction.
- The first ten prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29
How to Figure Out If a Number Is Prime
The most reliable manual method for checking primality is trial division up to the square root. Here's why this works: if a number n has any factor greater than โn, it must also have a corresponding factor smaller than โn. So you only need to test divisors up to โn.
The Trial Division Method โ Step by Step
- Find the square root of your number n. You only need to test divisors up to this value.
- Test divisibility by 2: If n is even and n โ 2, it's composite. If n = 2, it's prime.
- Test all odd numbers from 3 to โn: Check if any of them divide n evenly (remainder = 0).
- If none divide evenly: The number is prime.
- If any divides evenly: The number is composite. That divisor is the smallest prime factor.
- โ97 โ 9.85 โ test divisors up to 9
- Primes to test: 2, 3, 5, 7
- 97 รท 2 = 48.5 โ not divisible
- 97 รท 3 = 32.33โฆ โ not divisible (9+7=16, not divisible by 3)
- 97 รท 5 = 19.4 โ not divisible (doesn't end in 0 or 5)
- 97 รท 7 = 13.86โฆ โ not divisible
- Result: 97 is PRIME โ
How to Use a Prime Number Factor Calculator
A prime number factor calculator (also called a prime factorization calculator) breaks any composite number into its prime building blocks. This process is guaranteed by the Fundamental Theorem of Arithmetic, which states that every integer greater than 1 has a unique prime factorization โ one and only one way to be expressed as a product of primes.
The Division Method for Prime Factorization
The most systematic approach is the repeated division method: repeatedly divide the number by the smallest prime that goes into it evenly, until the quotient reaches 1.
- 360 รท 2 = 180
- 180 รท 2 = 90
- 90 รท 2 = 45
- 45 รท 3 = 15
- 15 รท 3 = 5
- 5 รท 5 = 1 โ stop here
- Result: 360 = 2 ร 2 ร 2 ร 3 ร 3 ร 5 = 2ยณ ร 3ยฒ ร 5
Uses of Prime Factorization
- Finding LCM and GCF: The Least Common Multiple and Greatest Common Factor of two numbers are easily found from their prime factorizations.
- Simplifying fractions: Divide numerator and denominator by their GCF (found via prime factorization) to reach lowest terms.
- Cryptography (RSA): The security of RSA encryption relies on the computational difficulty of factoring the product of two very large primes.
- Determining divisors: From the prime factorization pโ^a ร pโ^b ร โฆ, the total number of factors is (a+1)(b+1)โฆ
The Sieve of Eratosthenes โ Find All Primes in a Range
When you need to find all prime numbers up to a certain limit, checking each number individually is inefficient. The Sieve of Eratosthenes, developed by the ancient Greek mathematician Eratosthenes around 240 BC, is a far more efficient algorithm.
How the Sieve of Eratosthenes Works
- List all integers from 2 up to your target limit n.
- Start with p = 2 (the first prime). Mark all multiples of 2 as composite: 4, 6, 8, 10โฆ
- Move to the next unmarked number (which is 3 โ guaranteed prime since it wasn't crossed out). Mark all multiples of 3: 9, 15, 21โฆ
- Continue to the next unmarked number (5), mark its multiples (25, 35, 55โฆ)
- Stop when p > โn โ all remaining unmarked numbers are prime.
- All unmarked numbers remaining in the list are prime numbers.
The sieve is highly efficient because it eliminates large batches of composite numbers in each pass, rather than testing each number individually. Our free prime number calculator online uses the sieve for the Prime List mode.
Prime Numbers in Mathematics and Real Life
RSA encryption โ used to secure credit card transactions, messaging apps, and HTTPS โ relies on choosing two very large prime numbers (often 1,024+ bits). Factoring their product is computationally infeasible, keeping your data safe. This is why prime numbers are called the "atoms of arithmetic."
The Riemann Hypothesis โ one of the seven Millennium Prize Problems worth $1M โ is directly about the distribution of prime numbers. The Prime Number Theorem describes how primes become less frequent as numbers grow: approximately n/ln(n) primes exist up to n.
Hash table sizes are often chosen to be prime numbers to minimize collision clustering. Prime numbers are also used in pseudorandom number generators, checksum algorithms (like CRC), and efficient modular arithmetic in programming.
Prime factorization is core curriculum from elementary through high school โ used to find LCM and GCF, simplify fractions, solve ratio problems, and understand divisibility. This prime number calculator with step-by-step working is designed specifically to support learning at every level.
Common Questions About How to Figure Prime Numbers
Is 1 a Prime Number?
No. The number 1 is not prime and not composite โ it is a special case called a "unit." Primes are defined as having exactly two distinct positive divisors. The number 1 has only one divisor (itself), so it does not meet the definition. Historically, some mathematicians included 1 as prime, but excluding it is essential to preserve the uniqueness of prime factorization (the Fundamental Theorem of Arithmetic).
Is 2 the Only Even Prime?
Yes. 2 is the only even prime number. All other even numbers are divisible by 2 (giving them at least three factors: 1, 2, and themselves), making them composite. This is why 2 is sometimes called "the oddest prime" โ it's the only even one in an infinite sequence of odd primes.
What Are Twin Primes?
Twin primes are pairs of prime numbers that differ by exactly 2: (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43)โฆ It is conjectured (but not yet proven) that there are infinitely many twin prime pairs โ this is the Twin Prime Conjecture, one of the most famous unsolved problems in mathematics.
How Large Can Prime Numbers Get?
Arbitrarily large. As of 2024, the largest known prime number is a Mersenne prime โ a prime of the form 2^p โ 1 โ with over 41 million digits, discovered through the Great Internet Mersenne Prime Search (GIMPS). Our online prime calculator handles numbers up to 10 trillion for the primality check mode.
Tips for Using This Online Prime Number Calculator
- For primality checks: Enter any positive integer โฅ 2 in the "Is it Prime?" tab. The number 1 returns a "Neither" classification.
- For prime factorization: Enter any integer โฅ 2. If you enter a prime number, it will show the factorization as the number itself (since a prime's only prime factor is itself).
- For prime lists: Keep your range under 10,000 numbers for instant results. For 1โ1000, expect to see 168 prime numbers.
- Use quick examples: The preset buttons load famous primes (97, 99991) and highly composite numbers (1024 = 2ยนโฐ) to demonstrate the tool's capabilities.
- Learn from the steps: Even if you just need the answer, reading the step-by-step panel reinforces the trial division algorithm that math classes use.
Frequently Asked Questions
Common questions about prime numbers, primality testing, prime factorization, and using this free online calculator.
Select the Is it Prime? tab (it's the default), type your number into the input field, and click Check / Calculate. The result card will immediately display either "[Number] is PRIME" (in green) or "[Number] is COMPOSITE" (in indigo). The step-by-step panel below explains every divisibility test performed โ which primes were checked, the square root threshold, and why each divisor was accepted or rejected.
A prime number is a natural number greater than 1 that has exactly two distinct positive divisors: 1 and itself. This means it cannot be divided evenly by any other positive integer. For example, 7 is prime because its only divisors are 1 and 7. In contrast, 6 has divisors 1, 2, 3, and 6 โ making it composite. The number 1 is neither prime nor composite by definition.
No โ 1 is not a prime number. By definition, a prime must have exactly two distinct positive divisors. The number 1 only has one divisor (itself), so it fails the definition. Mathematicians also exclude 1 from primes to preserve the Fundamental Theorem of Arithmetic, which states that every integer โฅ 2 has a unique prime factorization. If 1 were prime, factorizations would no longer be unique (e.g., 6 = 2ร3 = 1ร2ร3 = 1ร1ร2ร3โฆ).
Prime factorization is the process of expressing a composite number as a product of prime numbers โ its "prime building blocks." Every composite number has exactly one unique prime factorization (Fundamental Theorem of Arithmetic). Switch to the Factorization tab, enter your number (e.g. 360), and click Calculate. The calculator uses repeated division โ dividing by the smallest possible prime at each step โ and displays the result in both linear form (2 ร 2 ร 2 ร 3 ร 3 ร 5) and exponential form (2ยณ ร 3ยฒ ร 5). Every division step is shown in the working panel.
The trial division method checks if a number n is divisible by any integer from 2 up to โn. If none divide evenly, n is prime. You only need to test up to โn because any factor larger than โn would require a corresponding factor smaller than โn, which you've already tested. In practice: check if n is even (divisible by 2), then test odd divisors 3, 5, 7, 9โฆ up to โn. The calculator shows each of these test steps for full transparency.
The Sieve of Eratosthenes is an ancient algorithm (circa 240 BC) for finding all prime numbers up to a given limit. It works by systematically marking multiples of each prime as composite, starting with 2. You list all numbers from 2 to n, then for each prime p found, cross out all multiples of p (4, 6, 8โฆ for p=2; 9, 15, 21โฆ for p=3; etc.). Any number not crossed out is prime. This calculator's Prime List mode uses the sieve to generate all primes in your chosen range instantly โ far faster than checking each number individually.
Modern internet security relies on prime numbers through RSA encryption. The RSA system works by multiplying two very large prime numbers (each hundreds of digits long) to create a public key. While multiplying two primes is trivial, factoring their product back into the original primes is computationally infeasible for large enough numbers โ this asymmetry is what secures HTTPS, online banking, email, and messaging. This is why prime numbers are sometimes called "the atoms of arithmetic" โ they are the fundamental building blocks of all integers, and their distribution is still not fully understood.
There are 25 prime numbers between 1 and 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97. Use the Prime List mode with "From: 1, To: 100" to generate this list instantly, along with the count. You can verify the count using the Prime Number Theorem approximation: ฯ(100) โ 100 / ln(100) โ 21.7 โ the actual count (25) is close to this estimate.
Yes โ prime factorization is the most reliable method for finding both. To find GCF: factorize both numbers, then multiply the lowest power of each common prime factor. For example, GCF(24, 36): 24 = 2ยณร3, 36 = 2ยฒร3ยฒ โ GCF = 2ยฒร3 = 12. To find LCM: multiply the highest power of each prime factor appearing in either number. LCM(24, 36): highest powers are 2ยณ and 3ยฒ โ LCM = 2ยณร3ยฒ = 72. Use the Factorization mode of this calculator to find the prime factors of both numbers, then apply these rules.
Twin primes are pairs of primes that differ by exactly 2, like (3,5), (11,13), (17,19), (41,43). Whether there are infinitely many twin prime pairs is an unsolved conjecture. Mersenne primes are primes of the form 2^p โ 1, where p itself is prime. Examples: 3 (2ยฒโ1), 7 (2ยณโ1), 31 (2โตโ1), 127 (2โทโ1). They grow very quickly and the largest known primes are always Mersenne primes โ the current record has over 41 million digits. The GIMPS project searches for new Mersenne primes using volunteer computing power.
More Free Calculators on WebToolTrix
Explore related math tools โ from quadratic equations to LCM, fractions, percentages, and more. All free, browser-based, no login needed.