Prime Factorization Calculator

Expanded
Next

Enter a positive integer of 2 or greater to split it into prime factors. The calculator shows the repeated factors and a compact version using exponents. It uses straightforward trial division; it does not list every divisor or use an advanced factorization algorithm.

How the factorization works

  1. 1

    Enter an integer

    Use decimal digits only and choose a value of at least 2.

  2. 2

    Divide out small factors

    The calculator tries 2, then successive integers while the candidate is no larger than the square root of the remaining value.

  3. 3

    Keep repeated factors

    Each exact division records the factor and continues with the quotient.

  4. 4

    Display both forms

    For 360, the expanded form is 2 × 2 × 2 × 3 × 3 × 5 and the compact form is 2^3 × 3^2 × 5.

Examples

Input Expanded form Exponent form
12 2 × 2 × 3 2^2 × 3
60 2 × 2 × 3 × 5 2^2 × 3 × 5
84 2 × 2 × 3 × 7 2^2 × 3 × 7
97 97 97
1024 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 2^10

Input and performance limits

  • Empty text, signs, decimal points, spaces and values below 2 do not produce a factorization. Negative integers are not converted to their absolute value.
  • The calculation uses PHP integers. Values outside the server’s integer range are not supported, even if a browser can represent or display them.
  • Trial division can become slow when a large input has no small factor. There is no Pollard rho or other fast fallback.
  • The output contains prime factors only. It does not calculate the complete divisor list.

Data handling

The standard form is a server-backed component, so the entered number is sent to the server as it updates. In the two-step view, the number is placed in the page URL to carry it to the result step. Do not treat the input as private or secret.

Frequently Asked Questions

Neither value has the prime-factor output this calculator expects, so it asks for an integer of 2 or greater.

No. Enter the positive absolute value yourself; the calculator accepts digit-only input of 2 or greater.

The prime itself appears as the sole factor in both output forms.

It must fit the server’s PHP integer type. Practical speed can be a much tighter limit because trial division may need many iterations.

Related Tools

Tool available in other languages