Factorial Calculator

MathLast updated: August 17, 2026

The factorial n! is the product of the integers from 1 up to n: 5! = 1 × 2 × 3 × 4 × 5 = 120. It is the basic building block of ordering (permutation) and selection (combination) problems; the number of different ways n distinct objects can be arranged is exactly n!.

Factorials grow astonishingly fast: 10! is about 3.6 million, 20! runs past a trillion, and 100! has 158 digits. This calculator computes the result EXACTLY for values up to 500; for very long results it shows the first 40 digits, the total digit count, the scientific notation, and the number of trailing zeros.

Enter an integer between 0 and 500.

Formula

n! = 1 × 2 × 3 × ... × (n − 1) × n
0! = 1 (by definition)
n! = n × (n − 1)!

It is easy to forget that 0! = 1: the empty set has exactly one arrangement, the empty one. The factorial of a negative integer is undefined, and the calculator warns you on such input.

How to Calculate

  1. Enter an integer between 0 and 500.
  2. Read n! as an exact integer in the results; for values longer than 40 digits, the first 40 digits and the total digit count are shown.
  3. Use the scientific notation and the number of trailing zeros to grasp the scale of the result.
  4. Study the table to see how the values grow from 0! up to 20!.

Worked Examples

5 factorial

5! = 1 × 2 × 3 × 4 × 5 = 120. In other words, 5 different books can be arranged on a shelf in 120 different orders. The result ends with 1 zero, which comes from the 2 × 5 among the factors.

Value of 5!: 120 · Scientific notation: ≈ 1.20 × 10² · Number of digits: 3

10 factorial

10! = 3,628,800 (roughly 3.6288 × 10⁶). A queue of 10 people can be formed in more than 3.6 million different orders, and the number ends with 2 zeros.

Value of 10!: 3,628,800 · Scientific notation: ≈ 3.6288 × 10⁶ · Number of digits: 7

100 factorial

100! is a number with exactly 158 digits: around 9.3326 × 10¹⁵⁷. It ends with 24 zeros, because up to 100 there are 20 multiples of five and 4 multiples of twenty-five (20 + 4 = 24).

Value of 100!: 9332621544394415268169923885626670049071… · Scientific notation: ≈ 9.3326 × 10¹⁵⁷ · Number of digits: 158

Frequently Asked Questions

What is a factorial and where is it used?
n! is the product of the integers from 1 to n, and it gives the number of different ways n objects can be ordered. It underpins permutations, combinations, the binomial expansion, probability, and Taylor series, among many other topics.
Why does 0! equal 1?
There is exactly one way to arrange no objects at all: the empty arrangement. Moreover, for the recursion n! = n × (n−1)! to stay consistent at n = 1 (1! = 1 × 0!), 0! must equal 1. This is also what makes combination formulas behave correctly in edge cases.
Do negative numbers have factorials?
The factorial is undefined for negative integers. Higher mathematics offers the gamma function, which extends the factorial to fractional values (Γ(n) = (n−1)!), but it too remains undefined at the negative integers.
Why do factorials grow so fast?
At every step the result is multiplied by an ever larger number, which is faster even than exponential growth. While 10! ≈ 3.6 × 10⁶, 20! ≈ 2.4 × 10¹⁸ and 100! has 158 digits. That is why pocket calculators typically overflow somewhere past 170!.
How do you find the number of trailing zeros in n!?
Every trailing zero comes from a factor of 2 × 5; since twos are plentiful, counting the fives is enough: ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + ... For 100!, that gives 20 + 4 = 24 zeros.
How does this tool compute values beyond 20! exactly?
Standard numeric types lose precision after roughly 18 digits. Because the calculator multiplies large values with arbitrary-precision integer (BigInt) arithmetic, every digit is exact up to 500!; only the on-screen display is shortened.