Loading…

Factorial Calculator

Math Algebra • Numbers

View all topics

Compute the exact factorial of a nonnegative integer: \[ \begin{aligned} n! &= 1\cdot2\cdot3\cdots n, \qquad n\ge1,\\ 0! &= 1. \end{aligned} \] The calculator uses integer arithmetic, shows the multiplication sequence, counts digits, and highlights trailing zeros.

Factorial input

Supported range: \(0\le n\le 5000\). The value is computed exactly using BigInt. For very large \(n\), the full integer may contain thousands of digits, so use the grouped or summary view if needed.

Quick examples

Ready
Enter a nonnegative integer, then click “Calculate”.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is a factorial?

For a nonnegative integer n, n! is the product of all positive integers from 1 to n. For example, 5! = 1 × 2 × 3 × 4 × 5 = 120.

What is 12 factorial?

12! = 479001600.

Why is 0! equal to 1?

0! is defined as 1 because it is the empty product and because it makes counting formulas and the recursive rule n! = n(n−1)! work correctly.

Can factorial be calculated for negative numbers?

In elementary arithmetic, factorial is defined only for nonnegative integers. Extensions such as the gamma function handle many non-integer values, but they are outside the scope of this calculator.

Why do factorials grow so quickly?

Each new factorial multiplies the previous result by the next integer, so the multipliers keep increasing.

How are trailing zeros in n! counted?

Trailing zeros come from factors of 10. Since 10 = 2 × 5 and factorials contain many factors of 2, the number of trailing zeros is found by counting factors of 5: floor(n/5) + floor(n/25) + floor(n/125) + ...

How many zeros are at the end of 100!?

100! has 24 trailing zeros because floor(100/5) + floor(100/25) = 20 + 4 = 24.

What does BigInt support mean?

BigInt support means the calculator can compute very large integer factorials exactly instead of rounding them as ordinary floating-point numbers.

Why does the graph use log10(i!)?

Factorials grow too quickly for an ordinary linear graph. A log10 scale shows the growth clearly while still representing the size of the factorial.

Where are factorials used?

Factorials are used in permutations, combinations, probability, binomial coefficients, series expansions, and many counting problems.