HomeCalculatorsMathNumber Theory & Discrete MathPrime Factorization Calculator
Math calculator

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.

Instant result
Result
—

Enter values to calculate.

Inputs—
Mode—
Formula—
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 — 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
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
Evidence
3 legacy golden · 2 legacy boundary · legacy regression suite · 92/92 oracle-backed golden · 5/5 invalid · Artifact integrity PASS
This calculator CURRENT · Public schema 1.0.1 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.1 · 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 6/6 · View evidence

  • n=12 → 2^2 × 3
  • n=13 → prime
  • n=1 → canonical=1
Sources
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.

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.