Factorial calculator (n!)

Computes n!, the product of every whole number from 1 to n, shown in full without rounding even for large n.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter number n.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

n! = 1 × 2 × 3 × and so on up to n, with 0! = 1. Trailing zeros = floor(n/5) + floor(n/25) + floor(n/125) and so on.

Example

Inputs: Number n = 10. Result: Factorial n!: 3,628,800; Number of digits: 7; Trailing zeros: 2.

Limits and caveats

  • Works for whole numbers from 0 to 3000 only; factorials of fractions (the gamma function) are not supported.

Questions about this tool

Why is 0! equal to 1?

There is exactly one way to arrange an empty set, and it keeps the permutation and combination formulas correct when r = n.

How many digits does 100! have?

100! has 158 digits and ends in 24 zeros.

Where do the trailing zeros come from?

Each zero comes from a factor 2 × 5. Fives are rarer, so you count multiples of 5, 25, 125 and so on.