Prime Factorization Calculator
Factor n = ∏ p^e and test primality for 1 ≤ n ≤ 10^12. Trial division. One capability, two modes.
Trust summary Engine tested · Specification checked · 11/11 tests · Production surface contract 3/3 · v1.0.0
- Input interpretation
- Enter values to calculate.
- Result
- —
- Model
- Prime factorization and primality for integers 1 ≤ n ≤ 10^12.
- Scope
- Unique factorization (fundamental theorem of arithmetic)
- Verification
- Engine tested · 11/11 tests · Production surface contract 3/3 · Specification checked · v1.0.0
- Named expert review
- Optional · Not performed
- Specification basis
- ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)
- Fundamental theorem of arithmetic
- Evidence
- 3 golden · 2 boundary · 6 property · Production surface contract 3/3 · Artifact integrity PASS
- Production
- Embedded snapshot: unpublished · Build schema 1.0.0 ready · Semantic contract ✓ · Attestation report not published on origin · Live production status PASS (0 stale; 164 CURRENT) @ 2026-09-16T06:44:24.909Z
- Semantic contract
- PASS
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.0 · Engine tested
- Engine tested 11/11 tests · Production surface contract 3/3
- Named expert review Not performed
- Calculation version 1.0.0
- 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 3/3 · View evidence
- n=12 → 2^2 × 3
- n=13 → prime
- n=1 → canonical=1
- Specification basis
- ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)
- Fundamental theorem of arithmetic
- Calculation version
- 1.0.0
Related tools
Other calculators in this family: Factorial Calculator, GCF Calculator, LCM Calculator, Modulo Calculator, Permutation Combination 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.