Premium Converters
Loading
Loading
Loading
Test whether any integer is a prime number using trial division up to its square root, and view the complete unique prime factorization for composite numbers.
Math
Generated on August 22, 2026
Test whether any integer is a prime number using trial division up to its square root, and view the complete unique prime factorization for composite numbers.
A prime checker tests whether a given integer is prime — that is, a natural number greater than 1 with no divisors other than 1 and itself — and, for composite numbers, shows the complete prime factorization. Primes are the building blocks of all positive integers (the Fundamental Theorem of Arithmetic guarantees every integer > 1 factors uniquely into primes) and are essential to number theory, cryptography (especially RSA public-key encryption), hashing, coding theory, and competitive mathematics. Everyone from students to professional cryptographers uses primality testing regularly.
Formula
Trial division: test whether n is divisible by 2, then by all odd numbers 3, 5, 7, … up to √n. For factorization, divide out each prime factor as it is found and continue from there.Maybe you're a CS undergrad working through your first cryptography assignment and need to confirm a number is prime before plugging it into an RSA toy example. Maybe you're prepping for an Olympiad or a competitive programming round where 'is n prime' shows up as a subroutine in half the problems. Or maybe you just noticed that 91 looks prime — it's odd, doesn't end in 5, no obvious factor — and you want to check, only to discover it's secretly 7 × 13. That last one catches even confident students because 91 violates the unstated expectation that a non-obvious composite would 'look' more composite. This checker uses trial division up to the square root (which is enough — anything larger pairs with a smaller divisor below the root) and is fast for any number under about 14 digits. For composites it also shows the full prime factorization, which is what you actually need most of the time. Pro tip: the square-root cutoff is the single most useful idea in beginner number theory. To check if 997 is prime, you don't need to test every divisor up to 996 — just up to about 31. That's the difference between feasible and absurd, and it's why this algorithm has survived since antiquity essentially unchanged. For cryptography-scale numbers (300+ digits), real-world tools use probabilistic tests like Miller-Rabin instead; this tool sticks to deterministic trial division for clarity.
A prime checker tests whether a given integer is prime — that is, a natural number greater than 1 with no divisors other than 1 and itself — and, for composite numbers, shows the complete prime factorization. Primes are the building blocks of all positive integers (the Fundamental Theorem of Arithmetic guarantees every integer > 1 factors uniquely into primes) and are essential to number theory, cryptography (especially RSA public-key encryption), hashing, coding theory, and competitive mathematics. Everyone from students to professional cryptographers uses primality testing regularly.
If n has a divisor greater than its square root, the matching co-factor must be smaller than the square root — so checking divisors only up to √n is sufficient to prove primality. Trial division is simple and fast enough for numbers with up to roughly 12 digits. For truly huge numbers (cryptographic primes with 300+ digits), probabilistic tests like Miller-Rabin are used instead; trial division would be impossibly slow at that scale.
The first 100 prime numbers for quick reference. Useful for math homework, cryptography basics, and number-theory work.
| Range | Primes |
|---|---|
| 1 – 50 | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 |
| 50 – 100 | 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 |
| 100 – 200 | 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199 |
| 200 – 300 | 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293 |
| 300 – 400 | 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397 |
| 400 – 500 | 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499 |
| 500 – 541 | 503, 509, 521, 523, 541 (100th prime) |
2 is the only even prime — all other evens are divisible by 2, so they can't be prime.
RSA encryption multiplies two ~300-digit primes — factoring the product is computationally infeasible, which is what keeps HTTPS secure.
Largest known prime (2024): 2^82,589,933 − 1, with nearly 25 million digits.
Twin primes: pairs that differ by 2 (3&5, 11&13, 17&19) — infinitely many conjectured but not yet proven.
29 is prime because no integer between 2 and √29 ≈ 5.39 divides it — a small classical prime.
100 = 2 × 2 × 5 × 5 = 2² × 5² — a very composite round number.
91 is not prime (7 × 13), despite looking prime at first glance — a famous surprise that catches many students.
997 is prime — the largest three-digit prime, useful as a hash table size in older code.
RSA encryption multiplies two 1024-bit primes to produce a 2048-bit modulus — the difficulty of factoring that product back into primes is what keeps the encryption secure.
The prime factorization of 360 is 2³ × 3² × 5, which is why 360 has so many divisors (24) — why it was chosen for degrees in a circle.
Jump to a ready-made conversion — useful for quick reference and sharing:
Scientific Calculator
Evaluate complex math expressions with trigonometric functions (sin, cos, tan), logarithms, exponents, square roots, parentheses, and constants like pi and e, following PEMDAS order.
Quadratic Equation Solver
Solve any quadratic equation ax² + bx + c = 0 using the quadratic formula, with the discriminant analysis showing two real roots, a repeated root, or complex conjugate roots.
Standard Deviation Calculator
Calculate the mean, variance, and both sample standard deviation (s, with Bessel's N−1 correction) and population standard deviation (σ) for any data set — used in statistics, finance, and quality control.
Permutation & Combination Calculator
Compute permutations (nPr, ordered arrangements) and combinations (nCr, unordered selections) using factorials — ideal for probability, lottery odds, poker hands, and password strength analysis.
Exponent / Power Calculator
Raise any base to any exponent — positive, negative, fractional, or decimal — to compute powers, reciprocals, and nth roots for compound interest, scientific notation, and computing.
Square Root Calculator
Compute the principal square root, cube root, square, and cube of any real number, with support for negative cube roots and irrational results like √2 for Pythagorean theorem work.
Logarithm Calculator
Calculate logarithms in any base, including common (log10), natural (ln), and binary (log2).
Triangle Solver
Solve any triangle from SSS, SAS, ASA, AAS, SSA, or right-triangle (Pythagoras) inputs. Drawn-to-scale visualization with all sides, angles, area, and perimeter.
Browse all Math calculators & converters
See every tool in this category, plus FAQs and category-specific guides.