Home › Math › Factorial Calculator

Factorial Calculator

Find n! for any whole number up to 1,000, with the exact value, the number of digits and the trailing zeros.

A whole number from 0 to 1,000.

n!

-

Number of digits-
Trailing zeros-
Scientific form-

Factorials from 0 to 20

nn!

What is a factorial?

The factorial of a whole number n, written n!, is the product of all the whole numbers from 1 up to n. It counts the number of ways to arrange n different items in a row.

n! = n × (n − 1) × (n − 2) × … × 2 × 1
n! = n × (n − 1)!
0! = 1

Example

5! = 5 × 4 × 3 × 2 × 1 = 120. This means 5 books can be arranged on a shelf in 120 different orders. 6! = 6 × 5! = 6 × 120 = 720.

Why is 0! equal to 1?

There is exactly one way to arrange nothing, which is to do nothing. It also keeps the rule n! = n × (n − 1)! working: 1! = 1 × 0!, so 0! must be 1. This is also what makes the permutation and combination formulas work when r is 0 or equal to n.

How many zeros are at the end of n!?

Each trailing zero comes from a factor of 10, which is 2 × 5. There are always more 2s than 5s, so you only need to count the 5s. Add up n ÷ 5, n ÷ 25, n ÷ 125 and so on, ignoring remainders. For 100!, that is 20 + 4 = 24 trailing zeros.

Where factorials are used

  • Counting arrangements, which are permutations.
  • Counting selections, which are combinations.
  • Probability, such as the chance of a particular card hand.
  • Series in higher maths, such as the expansions of e^x, sin x and cos x.

Factorials grow very fast. 10! is already about 36 lakh, 20! is more than 2 × 10^18, and 100! has 158 digits. This calculator is exact for every value from 0 to 1,000. Factorials of negative numbers and decimals are not defined here. To use factorials in counting problems, try the Permutation and Combination Calculator.

Need another calculator?

Browse all calculators
Scroll to Top