What a factorial is
The factorial of n, written n!, multiplies every whole number from 1 up to n: 5! is 5 times 4 times 3 times 2 times 1 = 120. It counts the number of ways to arrange n distinct things in order, which is why it sits at the heart of permutations and probability. This calculator returns the value, its digit count, and how many zeros it ends in.
How fast it grows
Factorials explode. 10! is already over three million, and 100! has 158 digits. That runaway growth is why the calculator shows huge results in scientific form and reports the exact digit count rather than an unwieldy full number.
Counting the trailing zeros
Each trailing zero comes from a factor of 10, which needs a 2 and a 5 — and fives are scarcer. So the number of trailing zeros equals how many times 5 divides into the numbers up to n: add up n over 5, n over 25, n over 125, and so on.
Related tools
To use factorials in counting problems, see the combinations and permutations calculator; for another fast-growing sequence, the Fibonacci calculator.
Worked example
10! = 3,628,800 — a 7-digit number ending in two zeros, since 5 divides the numbers up to 10 exactly twice (at 5 and at 10).
FAQ
Why is 0! equal to 1?
There is exactly one way to arrange nothing — the empty arrangement — so by convention and for consistency in the formulas, 0! is defined as 1.
Can factorials be taken of fractions?
Not with simple multiplication. Extending factorials to non-whole numbers needs the gamma function, which this calculator does not cover.
