StringMash.com

Factorial calculator

n! in full, every digit of it, worked out exactly.

2 characters
Updates as you type
20!2,432,902,008,176,640,000
Scientific2.4329 × 10^18
Digits19
Trailing zeros4
Every digit, exactly

Show the steps
  1. 20! = 20 × 19 × 18 × … × 2 × 1, every whole number from 20 down to 1 multiplied together.
  2. It ends in 4 zeros: each one is a 5 paired with a 2, and 20 ÷ 5 rounded down counts the 5s.

Using the calculator

Type a whole number up to 5,000. The factorial appears in full as you type, with its number of digits and how many zeros it ends in.

The answers are exact, not rounded. A phone calculator shows 25! as about 1.55 × 10^25; this gives all 26 digits.

What a factorial is

n! means every whole number from n down to 1 multiplied together. 5! is 5 × 4 × 3 × 2 × 1 = 120, and it counts the ways to put 5 things in a row.

The numbers grow fast. 10! is already 3,628,800, and 52!, the number of ways to shuffle a deck of cards, is about 8.07 × 10^67.

0! is 1. There's exactly one way to arrange nothing, and the rule n! = n × (n − 1)! needs it: 1! = 1 × 0!.

Why factorials end in zeros

Every trailing zero comes from a 10, which is a 2 times a 5. There are always more 2s than 5s among the factors, so counting the 5s gives the zeros. Divide n by 5, then by 25, then by 125, rounding each down, and add them up. For 100! that's 20 + 4 = 24 zeros.

Where the exclamation mark came from

The French mathematician Christian Kramp introduced the n! sign in 1808. The idea is much older. A Jain text, the Anuyogadvāra-sūtra, is one of the earliest known to describe factorials, and in 1677 Fabian Stedman used them to count the orders in which a set of church bells can ring.

Questions

What is 0 factorial?

1. There's one way to arrange nothing.

Can you take the factorial of a negative number or a fraction?

Not with this definition. The gamma function extends it to fractions, but negative whole numbers have no factorial at all.

How many digits does 1000! have?

2,568. Type 1000 to see them all.

Sources

Added and reviewed . What's new