Calcoid
Math

Factorial Calculator (n!)

Compute n! for any non-negative integer up to 1000. Uses BigInt for exact results above 170.

Factorial (n!)

10! =

3628800

Scientific notation: 3.628800e+6

Frequently Asked Questions about the Factorial Calculator (n!)

What is a factorial?
A factorial (written n!) is the product of every positive integer from 1 up to n. For example, 5! = 1 x 2 x 3 x 4 x 5 = 120. By definition, 0! = 1, which keeps combinatorial formulas consistent when you choose zero items from a set.
How fast does the factorial grow?
Very fast. 10! is 3,628,800; 20! is about 2.4 quintillion; 100! has 158 digits. Growth outpaces exponential functions, which is why factorials appear in problems where the number of possible arrangements explodes with just a small increase in n.
Why does this calculator switch to BigInt for large n?
JavaScript doubles hold exact integers only up to 2^53 (around 18!) and overflow to Infinity at 171!. To avoid both problems, the calculator computes an exact BigInt for every input, so you see all the digits for n up to 1000. It still reports a double-based scientific value for n up to 170, then derives the magnitude from the BigInt for n from 171 to 1000.
Where are factorials used?
Factorials appear in permutations and combinations (lottery odds, card-hand counts), probability distributions like the Poisson and binomial, Taylor series in calculus, and computer science topics such as algorithm analysis and recursive programming examples.
Why is 0! defined as 1?
There is exactly one way to arrange zero objects: do nothing. Defining 0! = 1 also keeps the recurrence n! = n x (n-1)! valid at n = 1, and it ensures combination formulas like nCr = n! / (r! x (n-r)!) give the correct result of 1 when r = 0 or r = n.