Everyday mathematics · Calculation notebook

Prime Factorization Calculator: Integer Factors: Worked Examples

Trace trial division to write integers as products of primes. Rebuild two factorizations by multiplication and check repeated factors, input bounds and 1.

Why the calculation is structured this way

Trial division removes prime factors and repeats them by multiplicity. Once the trial divisor exceeds the square root of the remaining quotient, any remaining quotient greater than one is prime. The uniqueness of prime factorization applies to positive integers greater than one; a negative sign is a separate factor, not a prime.

A second scenario you can verify

For −360, retain −1 and factor 360 = 2³ × 3² × 5. Multiplying −1 × 8 × 9 × 5 restores −360. Each exponent supplies one more divisor choice than its value: the full positive-divisor count is (3 + 1)(2 + 1)(1 + 1) = 24.

What changes the interpretation

The declared input cap controls worst-case trial-division work. A prime near the cap may need more trials than a composite with a small factor. Do not round a fractional input to an integer or infer primality from the absence of factors before a bounded search has completed.

Check the product and factor multiplicities independently

Prime factors are building blocks, not the full list of divisors. For 84, factorization is 2² × 3 × 7. The positive divisors include one, two, three, four, six, seven, twelve, fourteen, twenty-one, twenty-eight, forty-two and eighty-four. Listing only two, three and seven answers a different question from listing every divisor.

The exponent records multiplicity. For 1,080, remove factors of two three times to leave 135, then factors of three three times to leave five. The product is 2³ × 3³ × 5. Multiplying 8 × 27 × 5 restores 1,080. The positive-divisor count is (3 + 1)(3 + 1)(1 + 1) = 32, because each exponent can be chosen from zero through its recorded value.

A negative input retains its sign outside the prime list. For −84, the representation is −1 × 2² × 3 × 7. The factor −1 is not prime. Zero is divisible by every positive integer and does not have this finite unique prime-product representation. One is the empty multiplicative identity, but this display chooses to exclude ±1 rather than manufacture a prime factor for them.

Trial division should test repeated factors before advancing. After removing a divisor once, the remainder may still contain it. Once the trial divisor’s square exceeds the remaining quotient, a remaining value above one is prime. This stopping rule reduces work compared with checking every integer up to the original input.

An input cap bounds interactive workload rather than the theorem. A near-cap prime can be slower than a similarly large number with a small repeated factor. A decimal entry must be rejected, not rounded, because primality and factor multiplicity are integer properties. Preserve the original integer and compare the reconstructed product before using factors in GCD, LCM or divisor-count work.

This educational factorization does not estimate the practicality of factoring arbitrary cryptographic-size integers. Algorithms, input size and structure differ. A source explaining small-integer trial division does not certify a security assessment, and a fast answer for one composite does not imply the same runtime for every input.

Input reference and units

These values reproduce the model’s demonstration. Replace them with your own records or measurements; they are not recommended targets.

On a small screen, swipe horizontally to see all columns. With a keyboard, focus the table and use the arrow keys.

Parameters used by this calculator
ParameterDemonstration valueHow to enter it
Integer (absolute value 2 to 10¹²)360 Enter integer (absolute value 2 to 10¹²) without adding a unit suffix. Scope: Zero and ±1 have no prime-factor decomposition in this display.

Prime Factorization Calculator: calculation relationships

Decompose an integer into a product of prime factors using bounded trial division. Negative values retain a factor of −1, making the displayed product reproduce the original input. Zero and ±1 have no prime-factor decomposition in this display. Absolute values above 10¹² are excluded to bound interactive calculation time.

Divide by a prime repeatedly before moving to the next candidate. For 84, two divisions by 2 leave 21, then 3 and 7 complete 2×2×3×7. Testing beyond the square root of the remaining value is unnecessary: any composite remainder would already have a smaller factor. Multiplying the displayed factors independently is a useful check.

n = p₁ × p₂ × … × pₖ
  • value: Integer (absolute value 2 to 10¹²). Enter integer (absolute value 2 to 10¹²) without adding a unit suffix. Scope: Zero and ±1 have no prime-factor decomposition in this display.
  • Result units: stated beside each output
  • Calculation relationship: n = p₁ × p₂ × … × pₖ
  • Supported domain: see the limits below

Worked example

Prime Factorization Calculator baseline input: Integer (absolute value 2 to 10¹²): 360. Output: Prime factors = 2 × 2 × 2 × 3 × 3 × 5. Substitute these values into the displayed equation to reproduce the result.

Reproduce the default scenario

This reproduces the default inputs in the reference table above; it is not an additional independent example. Displayed rounding may differ from intermediate precision.

Prime factors
2 × 2 × 2 × 3 × 3 × 5

Common questions and boundary checks

Is −1 a prime factor?

No. It preserves the input sign; the remaining positive factors are prime.

Why are zero and one excluded?

They do not have the finite prime-product representation used for integers greater than one.

What does an exponent on a factor mean?

It records how many times that prime appears in the product.

How can I verify the answer?

Multiply every prime power and the retained sign to recover the original integer.

Does the bound restrict mathematics?

No. It limits interactive runtime, not the general factorization theorem.

Sources and content notes

Toolify describes the implemented algorithm and its assumptions. Sources below support the topic or applicable rules; they do not endorse this calculator. Examples are illustrative, and published rules take precedence over simplified estimates.

Report a formula, example or translation issue through our contact page. Include the tool name, inputs and expected result so it can be reproduced. Contact Toolify

From question to result

Continue with a related question

Explore all Everyday mathematics tools and guides