How a factorial works
The factorial of n, written n!, is the product of all whole numbers from 1 to n. It counts the number of ways n distinct items can be arranged in order.
- n — a whole number from 0 to 170
- n! — the factorial — product of 1 through n
More detail
Why 0! = 1
0! is defined as 1, not 0. A factorial counts arrangements (permutations), and there is exactly one way to arrange nothing — the empty arrangement. This convention also keeps formulas like the binomial coefficient n! / (k!(n−k)!) working when k = 0 or k = n.
How fast it grows. Factorials explode: 10! is already 3.6 million, 13! passes a billion, and 170! is about 7.3 × 10³⁰⁶ — near the largest number a computer's double-precision float can hold. That's why this tool caps at 170.
Frequently asked questions
What is 5 factorial (5!)?
5! = 5 × 4 × 3 × 2 × 1 = 120. Enter 5 above to see the expansion and result.
What is 0 factorial (0!)?
0! = 1 by definition — there is exactly one way to arrange an empty set (the empty product). It is not 0.
What is 10 factorial?
10! = 3,628,800 — the product of every whole number from 1 to 10. Enter 10 above to confirm.
Why can't I calculate factorials above 170?
171! is larger than about 1.8 × 10³⁰⁸, the maximum a standard double-precision floating-point number can represent, so it overflows to infinity. The input box does not block larger numbers — enter 171 or more and the calculator shows a "too large" notice in place of a result.