From primality to GCF
- Factorize each input (e.g. 24 and 36) with the factor tree.
- List prime powers: 24 = 2³×3, 36 = 2²×3².
- Take minimum exponents per shared prime → GCF = 2²×3 = 12.
- Open the GCF calculator to verify with the Euclidean algorithm.
Loading tool…
A **prime number** is a whole number greater than 1 whose only positive divisors are 1 and itself. **2** is prime and the only even prime; every other even n > 2 is composite because 2 divides it. **1** is neither prime nor composite—the definition requires exactly two distinct divisors.
**Prime vs composite:** 97 has no divisor from 2 through 9 (√97 ≈ 9.8), so it is prime. 91 looks prime but 91 ÷ 7 = 13, so 91 = 7 × 13 is composite. The **fundamental theorem of arithmetic** states every integer n > 1 factors into primes in exactly one way (ignoring order).
**Prime factorization** splits a composite into prime powers—360 = 2³ × 3² × 5. Our factor tree visualizes this split step by step. **Trial division** tests divisors d from 2 to √n; if none divide evenly, n is prime. This is exact and ideal for classroom sizes.
For n up to 10¹², this calculator uses **deterministic Miller–Rabin** with fixed witness bases—probabilistic in theory but exact for the bounds we support. Lists and ranges use the **Sieve of Eratosthenes** (O(n log log n)), far faster than testing each integer alone.
**Prime density** thins as numbers grow: π(x) ≈ x/ln(x) (prime number theorem). **Twin primes** like (11, 13) differ by 2; whether infinitely many exist is still open. **Prime gaps** between consecutive primes can grow—our tool shows next/previous prime and gap size.
**Cryptography:** RSA multiplies two large secret primes. This page targets educational sizes—not 2048-bit key generation—but the RSA panel explains why primality at scale matters.
Connect to **GCF** (minimum prime exponents) and **LCM** (maximum exponents) once factors are known.
Check primality, factor composites with an interactive tree, list or range-generate primes, find the nth prime, and compare trial division vs Miller–Rabin—all locally in your browser.
Check, Factorize, List, Range, Nth, or Random—quick examples load 97, 91, or primes ≤100 instantly.
Type n for check/factorize, an upper limit for lists, or min/max for ranges and random generation.
Verdict, factor tree, trial steps (when enabled), next/prev prime, twin check, and divisor count τ(n).
Open the Algorithm panel for trial vs Miller–Rabin, copy or download TXT/CSV, or share a URL restoring your inputs.
Use GCF, LCM, combination, or factorial calculators once prime structure is clear.
Common real-world scenarios where this tool saves time.
Set Check mode on 91, 97, or 541. Composite answers show the smallest factor; primes show next/previous prime and gap.
Factorize 360 or 84, click tree nodes, then open the GCF or LCM calculator with prime exponents in mind.
List primes to 100 or range 50–150—watch the animated sieve and density chart competitors rarely include.
Ask for the 25th prime (97) or pick a random prime between 100 and 500 for quiz questions.
Check 11, 13, or 41 to see twin-pair flags and prime-gap statistics beside the verdict.
Step-by-step chains that connect related tools for common tasks.
Input
97Output
Prime — no divisor ≤ 9Trial division through √97 finds no factors. Common exam trick question.
Input
91Output
Composite — 7 × 13Smallest factor 7. Many students guess prime because 7 and 13 are both prime.
Input
360Output
2³ × 3² × 5Interactive tree splits 360 → 2×180 → … until all leaves are prime.
Input
11 and 13Output
Both prime; gap 2Check mode flags twin pairs when p and p+2 are both prime.
Input
nth = 25Output
97The prime sequence starts 2, 3, 5, 7, …; the 25th term is 97.
Input
Primes ≤ 30Output
2, 3, 5, 7, 11, 13, 17, 19, 23, 29Ten primes below 30—matches π(30) = 10.
Small and medium n use trial division with optional step-by-step output (n ≤ 10⁶). Larger n switch to deterministic Miller–Rabin. Prime lists and ranges use the Sieve of Eratosthenes; nth prime uses incremental sieving.
Formula
Primality (trial): n prime iff ∀d ∈ [2, ⌊√n⌋], n mod d ≠ 0. Miller–Rabin: write n−1 = 2^s·d; test bases a; if a^d ≢ 1 (mod n) and a^(2^r·d) ≢ n−1 for all r < s, n is composite. Sieve: mark multiples of each prime p ≤ √N starting at p².| Method | When used | Complexity | Exact? |
|---|---|---|---|
| Trial division | n ≤ 10⁶ with steps; small checks | O(√n) | Yes |
| Miller–Rabin (deterministic bases) | n > 10⁶ up to 10¹² | O(k log³ n) | Yes within supported bound |
| Sieve of Eratosthenes | Lists and ranges ≤ 500 | O(N log log N) | Yes |
| n | Smallest factor | Class | Note |
|---|---|---|---|
| 51 | 3 | Composite | 3 × 17 |
| 53 | — | Prime | No d ≤ √53 |
| 57 | 3 | Composite | 3 × 19 |
| 59 | — | Prime | Twin with 61 |
| 91 | 7 | Composite | 7 × 13 trap |
Eliminate 2, 3, 5, and 11 with quick rules before scanning larger trial divisors.
Step-by-step trial division teaches √n stopping; large n automatically uses Miller–Rabin without flooding the UI.
Prime exponents from factor trees map directly to greatest-common-factor and least-common-multiple formulas.
Scan twin pairs and gaps in a bounded interval—then try Practice mode to test yourself.
Definition requires exactly two distinct positive divisors. One has only one divisor.
If n = a×b with a ≤ b, then a ≤ √n. Stop trial division at the floor of √n.
9, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, 55, 57, 63, 65, 69, 75, 77, 81, 85, 87, 91, 93, 95, 99 are odd composites below 100.
Checking whether 541 is prime stops at first factor; factorizing 360 builds the full product 2³×3²×5.
RSA needs secret primes with hundreds of digits and side-channel-safe generation—use dedicated crypto libraries.
Production cryptography needs hardware-grade randomness, side-channel-safe prime generation, and primes with hundreds of digits. Use vetted libraries (OpenSSL, libsodium, or your language’s crypto module)—not a browser educational calculator capped at 10¹².
This tool accepts integers up to 10¹² for primality and factorization. Beyond that, use computer algebra systems (SageMath, Mathematica, Wolfram Alpha) or research-grade factoring software.
List and range modes cap at 500 numbers for browser performance. For π(10⁹) tables, prime gaps at scale, or distributed sieve jobs, use specialized number-theory tools—not a client-side web calculator.
Prime factorization supports GCF/LCM work, but once you know the task is greatest common factor or least common multiple, the GCF calculator and LCM calculator compute the answer faster with Euclidean steps—without re-deriving every prime factor by hand.
Trial division and Miller–Rabin here give correct results within supported bounds, but they are not proof certificates for journals. For provable primality of record-sized candidates, use ECPP, Pocklington, or systems like Primo.
If the question is “do a and b share a factor?” or “does d divide n?”, checking one number for primality is the wrong workflow. Use GCF for shared factors, or test n mod d directly—primality mode only classifies a single integer.
Practice mode and local twin/gap stats illustrate patterns for learning. They do not settle open problems or replace large-scale computation used in number-theory research.
Advertisement
Neither. Primes must exceed 1. Zero is divisible by every integer; one has exactly one positive divisor.
Trial division with steps is shown for n ≤ 1,000,000. Larger accepted inputs use deterministic Miller–Rabin so the calculator stays fast and correct up to 10¹² without listing millions of divisors.
List integers 2…N, mark multiples of each prime p starting at p², and collect unmarked numbers. Our list and range modes use this; the animation shows crosses appearing in order.
Pairs (p, p+2) where both are prime—e.g. (3,5), (11,13), (17,19). Check mode flags when n is part of such a pair.
RSA public keys multiply two large secret primes. Factoring the product is hard—that hardness secures encryption. This page demonstrates the math at educational sizes only.
Twenty-five: the last is 97. List mode confirms π(100) = 25.
Divisors pair: if n = ab and a ≤ b, then a ≤ √n. A factor larger than √n would imply a smaller partner already tested.
Factor each input. GCF uses the lowest exponent of each shared prime; LCM uses the highest exponent across inputs.
All primality tests, factorizations, and lists run in your browser. Inputs are not uploaded to EverydayTools servers.
Trial division and sieve outputs are exact. Miller–Rabin uses deterministic witness sets for n ≤ 10¹². Automated tests cover classics (91, 97, 360, π(100)=25).
Educational tool only—not cryptographic key generation, not a substitute for instructor grading on proofs.
Advertisement
Reviewed by EverydayTools Mathematics Team — number theory & calculator QA on 2026-07-05.
Same workflow or intent — pick the next step without leaving the site.
Calculate factorial n! for 0 ≤ n ≤ 500 with exact big-integer results. No upload—runs locally in your browser. Free, instant n! for combinatorics.
Calculate permutations nPr = n!/(n−r)! when order matters—5P2, 10P3, 26P3 & more. Runs locally in your browser, no upload. Exact results up to n=500.
Calculate combinations nCr = n!/(r!(n−r)!) for unordered selections. No upload: runs locally in your browser. Free, instant nCr results.
Calculate powers like a^b, negative exponents, and fractional exponents with clear results and quick examples like 2^3 = 8. Runs locally in your browser when supported—no upload required for normal use.
Free fraction calculator with steps: add, subtract, multiply, divide, simplify, and show mixed/decimal forms instantly. Fast, private, no signup. Runs locally in your browser when supported—no upload required for normal use.
Find the greatest common factor of two or more integers using the Euclidean algorithm and factor-method explanations. Runs locally in your browser when supported—no upload required for normal use.
Frequently opened tools from the same category.
Calculate BMI from height and weight using metric or imperial units. See BMI category ranges and use it as a quick screening estimate. Runs locally in your browser when supported—no upload required for normal use.
Estimate daily calories using the Mifflin-St Jeor BMR formula and TDEE activity multipliers for maintenance, weight loss, or weight gain. Runs locally in your browser when supported—no upload required for normal use.
Free tip calculator — find tip amount, bill + tip total, and per-person share. Presets for common percentages (10%, 15%, 20%), custom %, and equal split. Runs in your browser. No signup.
What is 20% of 500? Percent increase, decrease, difference, reverse %, markup & margin—runs locally in your browser, no upload. Copy results or share a link.
Cross-category tools others open in the same session.
Free JSON formatter — paste minified or messy JSON and instantly get beautified, indented output with syntax highlighting and error detection. Browser-based, no server upload. Runs locally in your browser when supported—no upload required for normal use.
Compress JPG, PNG & WebP in your browser—up to 80% smaller, batch 25 files, 50/100/200 KB presets. Files stay on your device. No signup.
Free PDF merger — combine multiple PDF files into one document. Drag to reorder files, preview pages, and download the merged PDF instantly. No signup, fully browser-based. Runs locally in your browser when supported—no upload required for normal use.
Instantly count words, characters, sentences, paragraphs, and reading time. Great for essays, articles, and SEO writing. No signup — works as you type. Runs locally in your browser when supported—no upload required for normal use.
Guides and walkthroughs that reference this tool.
10 free browser calculators: BMI, tip, discount, overtime, GPA, compound interest. No upload—runs locally. No signup.
2026 roundup of BMI calculators—EverydayTools, CDC, NIH, Healthline, and Calculator.net compared on accuracy, privacy, units, and clinical context.
Browse full tool collections by topic.
Result
97 is prime
Primality: trial division through √n.
Classics
Factor trees
Explore
Interactive factor tree
Green = prime · Amber = composite · Click any node to check it
Run List mode (primes up to N) to animate the Sieve of Eratosthenes.
Trial division
Tests divisors 2 through √n. Step trace when n ≤ 1,000,000 and enabled.
Complexity: O(√n)
Used for this resultMiller–Rabin
Deterministic bases for n ≤ 10¹². Used when trial steps are impractical.
Complexity: O(k log³ n)
Active: Trial division — Test divisors 2 through √97 (9). Exact for all n in step range.
RSA security relies on the difficulty of factoring n = p × q when p and q are large primes. This educational tool handles classroom-sized integers—not cryptographic key generation.
Is 51 prime?