Factorial Calculator

Results

Enter any non-negative integer from 0 to 1000 and get n!, the product of every positive integer up to and including n. The calculator uses arbitrary-precision arithmetic, so values like 100! (158 digits) or 1000! (2568 digits) are returned exactly, not truncated. Useful for combinatorics homework, permutation counts, probability derivations and anywhere a recursion boils down to a factorial term.

How to compute a factorial

  1. 1

    Enter n

    Type the non-negative integer you want the factorial of. By convention, `0! = 1`.

  2. 2

    Get the exact value

    The result appears as a full-precision integer, even for hundreds of digits.

  3. 3

    Check the digit count

    For very large values, the digit count below the result shows the magnitude at a glance; `1000!` runs to 2,568 digits.

  4. 4

    Copy for your calculation

    Copy the exact integer into your notes, a spreadsheet or another tool.

Factorial reference and growth

Factorials grow faster than any exponential. Below is the usual cheat sheet showing how quickly the value explodes and where IEEE-754 double precision runs out.

Small values

n n!
0 1
1 1
5 120
10 3,628,800
13 6,227,020,800
20 2,432,902,008,176,640,000

Overflow boundaries

  • 32-bit signed int: overflows at 13! (max value ~2.1 billion; 12! = 479,001,600 is the last that fits, 13! = 6,227,020,800 does not).
  • 64-bit signed int: overflows at 21! (20! is the last one that fits).
  • IEEE-754 double: becomes inexact at 22!; 170! is the largest finite double.

Stirling’s approximation

For large n, Stirling gives a useful closed-form estimate:

n! ≈ √(2πn) · (n/e)^n

With n = 100, Stirling returns 9.3248 x 10^157, less than 0.1% off the exact 100!. Use it when a precise integer is not required and you only need order-of-magnitude reasoning.

Common uses

  • Permutations: arrangements of n distinct items in order = n!.
  • Combinations: C(n, k) = n! / (k! (n - k)!).
  • Probability: the denominator of many discrete distributions.
  • Series: Taylor expansions, where coefficients include factorial terms.

Edge cases

  • 0! = 1 by convention (empty product). This is not a limit; it is a definition that makes combinatorial formulas consistent.
  • Negative integers and non-integers do not have a factorial in the elementary sense; the Gamma function extends the idea: Γ(n+1) = n! for non-negative integers.

Frequently Asked Questions

The calculator accepts n from 0 to 1000. The largest input, 1000!, has 2,568 digits and is computed instantly. Values above 1000 are clamped to the cap.

It is a convention chosen so that formulas like nCk = n! / (k!(n-k)!) stay correct when k = 0 or k = n. It is also the value of the empty product, which is the multiplicative identity.

This tool focuses on the discrete factorial. For non-integer arguments you need the Gamma function; many science libraries expose Γ(n) and Γ(n+1) = n! on integers, letting you extend factorials to the reals.

No. The calculator does not store your number in a database and does not use it for anything beyond computing the factorial. In the multi-step view the value is carried in the page link so the results step can display it.

Related Tools

Tool available in other languages