HomeCalculatorsMathNumber Theory & Discrete MathPrime Factorization Calculator
Math calculator

Prime Factorization Calculator

Factor n = ∏ p^e and test primality for 1 ≤ n ≤ 10^12. Trial division. One capability, two modes.

Instant result
Result
—

Enter values to calculate.

Inputs—
Mode—
Formula—
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · all published modes
Input interpretation
Enter values to calculate.
Result
—
Verified scope
all published modes
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 · Specification checked · v1.0.0 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · all published modes· View Manifest · CVP overview · Specification
Versions
Calculation 1.0.0 · CVP protocol 1.0.0-proposed · Evidence 2026-09-22.discrete-algebra-cvp
Verification revision
2026-09-22.discrete-algebra-cvp · 3/3 property · digest cfb4476b4373
Legacy regression
11/11 tests · Production surface contract 5/5
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 — ui-ssr is query-result HTML, not a live browser session. Error-path engine·REST·MCP 1/1 (status, code, calculation_version). SSR compared on URL-canonical requested calculations; empty query is idle (not an error) and JSON-typed object/array inputs are REST/MCP-only.
Supplemental domain review
Not performed
Named expert review
Not performed
CVP suite
5/5 golden · 3/3 CVP boundary · 5/5 invalid · 3/3 property · 3/3 cross-interface · 1/1 cross-calculator · 5/5 CVP contract · Manifest
Specification basis
  • ISO 80000-2:2019 Quantities and units — Mathematics (primes / factorization)
  • Fundamental theorem of arithmetic
Specification basis
Evidence
3 legacy golden · 2 legacy boundary · legacy regression suite · 5/5 oracle-backed golden · 5/5 invalid · Artifact integrity PASS
This calculator CURRENT · Public schema 1.0.0 matches · Semantic contract ✓ · Production attested · Public/cache ✓ · Origin ✓
Semantic contract
PASS
Full verification

Manifest identity, reference classes, interfaces, suite, and production records.

Formulas

Core equations used by this calculator.

Canonical formn = p₁^{e₁} × p₂^{e₂} × …
Primen is prime iff the factorization is n¹
iTrial division up to √n. Domain 1 ≤ n ≤ 10¹². Not a cryptographic primality prover.

How to use

1

Choose factorize or primality

Both modes return the same factorization object. is_prime is a view of that result.

2

Enter a positive integer n

1 ≤ n ≤ 10^12.

3

Read primes and exponents

ω is the number of distinct primes. Ω counts with multiplicity.

Example calculations

Common configurations with formula and result.

ϟ

12

Composite

12 = 2² × 3
2^2 × 3
ϟ

13

Prime

13
prime
ϟ

1

Empty factorization

1
neither prime nor composite

Prime Factorization calculator specification

Version 1.0.0 · Engine tested

Calculation status

Review policy · Evidence

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 5/5 · 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

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.