Prime Factorization Calculator
Find exact prime factors and test primality for integers from 1 to 10^12. Check exponents, view complete factorization steps, and export or share results.
Enter values to calculate.
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · Sampled complete packs for both published modes, one/prime/prime-powers/semiprimes and bounded near10^12 cases
- Input interpretation
- Enter values to calculate.
- Result
- —
- Verified scope
- Sampled complete packs for both published modes, one/prime/prime-powers/semiprimes and bounded near10^12 cases
- Assurance
- Core
- Declared partition coverage
- PASS · 3/3 declared partitions (factorize, is-prime, invalid-domain) · Matrix
- Known limitations
- Core CVP does not include live graph, viewport, or pointer interaction.
- Model
- Prime factorization and primality for integers 1 ≤ n ≤ 10^12.
- Scope
- Unique factorization (fundamental theorem of arithmetic)
- Verification
- Engine tested · Source checked · v1.0.1 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · Sampled complete packs for both published modes, one/prime/prime-powers/semiprimes and bounded near10^12 cases· View Manifest · CVP overview · Specification
- Versions
- Calculation 1.0.1 · CVP protocol 1.0.0-proposed · Evidence 2026-10-28.meta-metrics-v2
- Verification revision
- 2026-10-28.meta-metrics-v2 · 3/3 property · digest b9d3ea059680
- Legacy regression
- 11/11 tests · Production surface contract 6/6
- Trust layers
- Verification VERIFIED · Production CURRENT · Overall CVP state: VERIFIED under CVP 1.0.0-proposed
- Reference
- O1 model · O2 expected_values · O2 numerical_behavior
- Interfaces
- PASS · UI (SSR) / REST / MCP
- Supplemental domain review
- Not performed
- Named expert review
- Not performed
- CVP suite
- 92/92 golden · 3/3 CVP boundary · 5/5 invalid · 3/3 property · 2/2 metamorphic · 3/3 cross-interface · 1/1 cross-calculator · 6/6 CVP contract · Manifest
- Sources
- ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)
- Fundamental theorem of arithmetic
- MIT Mathematics for Computer Science — Chapter 8: Number Theory
- Evidence
- 3 legacy golden · 2 legacy boundary · legacy regression suite · 92/92 oracle-backed golden · 5/5 invalid · Artifact integrity PASS
- Semantic contract
- PASS
Full verification
Formulas
Core equations used by this calculator.
How to use
Choose factorize or primality
Both modes return the same factorization object. is_prime is a view of that result.
Enter a positive integer n
1 ≤ n ≤ 10^12.
Read primes and exponents
ω is the number of distinct primes. Ω counts with multiplicity.
Example calculations
Common configurations with formula and result.
12
Composite
13
Prime
1
Empty factorization
Prime Factorization calculator specification
Version 1.0.1 · Engine tested
- Engine tested 11/11 tests · Production surface contract 6/6
- Named expert review Not performed
- Calculation version 1.0.1
- Definition
- Every integer n > 1 has a unique factorization into primes, up to order. n = 1 has no prime factors and is neither prime nor composite.
- What it calculates
- Prime factorization and primality for integers 1 ≤ n ≤ 10^12.
- Inputs
- mode?
- n
- Outputs
- is_prime
- factors
- canonical
- omega
- big_omega
- Formula
n = ∏ p_i^{e_i}- Assumptions
- Unique factorization (fundamental theorem of arithmetic)
- Trial division
- n = 1 is neither prime nor composite
- Units
- dimensionless
- Boundary conditions
- missing n → MISSING_REQUIRED_INPUT
- n < 1 → VALUE_MUST_BE_POSITIVE
- n > 10^12 → VALUE_ABOVE_MAX
- unknown mode → INVALID_MODE
- Example
- n=12 → 2^2 × 3
- Validation cases
3 published on this page · 11/11 tests · Production surface contract 6/6 · View evidence
- n=12 → 2^2 × 3
- n=13 → prime
- n=1 → canonical=1
- Sources
- ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)Supports: Mathematical symbols and notation. This standard is not numerical verification or an endorsement of this implementation.
- Fundamental theorem of arithmetic
- MIT Mathematics for Computer Science — Chapter 8: Number Theory — Chapter 8, including sections 8.2–8.9 and problem 8.24Supports: Divisibility, prime factorization, gcd and the Euclidean algorithm, lcm via prime exponents, division with remainder, modular congruence and multiplicative inverses. CalculatorX’s signed-remainder and zero-input policies are stated separately on the page. Mathematical reference only; not validation or endorsement of this implementation.
- ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)
- Calculation version
- 1.0.1
Background
Interpretation and common distinctions.
What does this prime factorization calculator compute?
Every integer n > 1 has a unique factorization into primes, up to order. n = 1 has no prime factors and is neither prime nor composite.
The published formula or method is n = ∏ p_i^{e_i}. The following references support the stated mathematics or method:
- MIT Mathematics for Computer Science — Chapter 8: Number Theory: Divisibility, prime factorization, gcd and the Euclidean algorithm, lcm via prime exponents, division with remainder, modular congruence and multiplicative inverses. CalculatorX’s signed-remainder and zero-input policies are stated separately on the page. Mathematical reference only; not validation or endorsement of this implementation.
Which inputs and limits should you check?
Use a safe JSON integer or a signed decimal digit string with 1 ≤ n ≤ 10^12, at most 13 digits (including leading zeros) and 512 characters per string. Integer strings reject decimal points, scientific notation and separators. JSON numeric inputs follow the general binary64 transport policy; use digit strings to preserve the exact source integer. Unknown fields, null, booleans, nested values and conflicting n/nInput aliases are refused.
Both modes return the complete, ascending list of prime factors and positive exponents. The canonical product is exact; ω counts distinct factors and Ω counts multiplicity. For 1, factors is empty, both counts are zero and the classification is neither prime nor composite. Trial division uses exact BigInt arithmetic up to sqrt(n); a one-unit change in n can change its factorization completely. This bounded tool does not accept cryptographic-size integers.
The result also includes the normalized integer, identity, classification, method, complete textual work and calculation version. Clearing produces an error state and disables result exports; Reset restores 12. Matching aliases are accepted; conflicting ones are errors.
The worked example uses Composite with 12 = 2² × 3. Compare it with the Example calculations and the complete result for the same inputs.
How can you verify and cite this result?
CalculatorX is responsible for this page. The mathematical references above explain the model; implementation checks and their scope are documented separately in the math.prime_factorization v1.0.1 Evidence and capability contract. Read the displayed verification and production state together with the specification's numerical limits.
Use the clean calculator URL to cite the tool. A shared input link identifies a particular calculation. Content updates, numerical verification, and domain reviews have separate dates and scopes.
Sharing, exports and privacy
Typing computes locally. A copied URL reopens the current engine; an older calculation-version query displays a current-version notice rather than replaying a historical runtime. Native CSV and JSON retain the complete factor list, exponents, counts, work and raw inputs. Sharing URLs and calling REST/MCP send inputs to the server and may enter logs; browser calculation history may persist locally and can be cleared. Site analytics and hosting policies are described in the privacy policy; this page does not promise zero logs or a fixed retention period.
Related tools
Other calculators in this family: Arithmetic Sequence Calculator, Factorial Calculator, Fibonacci Calculator, GCF Calculator, Geometric Sequence Calculator, LCM Calculator, Modular Inverse Calculator, Modulo Calculator . Explore all Number Theory & Discrete Math.
Frequently asked questions
Key distinctions behind the calculation.
Is 1 prime?
No. 1 has an empty prime factorization and is neither prime nor composite.
Are factorization and primality two calculators?
No. One capability, two modes. Primality is whether the factorization is a single prime to the first power.
Where does this run?
Locally in the browser by default. REST and MCP call the same prime-factorization engine.