No ads, no sign-upChecked 2026-08-25

Factorial Calculator

Your numbers

Change any value to update the result.

Factorial

120

Factorial: 120
Examples
How the result moves

Your current valid inputs, with one value varied across the range.

Number n → Factorial
Number n: 5; Factorial: 120

How the result moves

Number nFactorial
424
5Your value120
6720

n! multiplies every whole number from 1 up to n, so 5! is 1 × 2 × 3 × 4 × 5 = 120. It counts the orderings of n different things: five runners can finish in 120 ways. By definition 0! is 1.

Worked examples

How it's calculated

n! = 1 × 2 × 3 × … × n

  1. StepEnter a whole number from 0 to 21.Number n=5
  2. StepEvery integer from 1 up to n is multiplied together.
  3. ResultThe answer is also the number of ways to order n items.Number n=5→120

Reference table

nReads asn!
0the empty arrangement1
1one item, one order1
51 × 2 × 3 × 4 × 5120
10orderings of ten items3628800
13past six billion6227020800
20past two quintillion2432902008176640000
21last value this formatter prints exactly51090942171709440000

Questions

What is a factorial?

A factorial is the product of every positive whole number up to n, written n!, so five factorial is 1 × 2 × 3 × 4 × 5 = 120. It counts the ways to arrange n distinct items in order, which is why it turns up throughout probability, combinations and permutations.

Why does 0! equal 1?

There is exactly one way to arrange an empty set — the empty arrangement — so the count is 1, not 0. It also keeps the formulas consistent: the recurrence that turns n factorial into n × (n − 1) factorial makes one factorial equal 1 × zero factorial, which only works out if zero factorial is 1.

What do factorials actually count?

The number of distinct ways to put n different items in a row. Three books have six possible shelf orders, five runners have 120 possible finishing orders.

How fast do factorials grow?

Faster than any exponential. Five factorial is only 120, but ten factorial is already 3,628,800 and twenty factorial is over 2.4 quintillion. Each step multiplies by the next integer, so the value explodes.

Why does this tool stop at 21!?

The factorial of 18 is the last within JavaScript's safe-integer range, but those of 19 through 22 are still individually exact binary64 values. This calculator stops at 21 because its current Number formatter rounds the printed tail of the factorial of 22, even though that value is exact internally. At 23, the Number value itself differs from the true integer.

Sources and last check

  1. mathworld.wolfram.com

Information, not professional advice.