Skip to content
K Knidox Search…
Math · Combinatorics

Factorial Calculator

Compute n! exactly, with the full expansion.

A whole number from 0 to 170.
5!
120

0! = 1 by definition.

How fast the factorial grows (k! for small k)

A factorial n! multiplies every whole number from n down to 1, counting how many ways n distinct items can be ordered. So 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention 0! = 1, and factorials grow extremely fast.

What a factorial counts

The factorial n! multiplies every whole number from n down to 1. Concretely, it counts the number of ways to arrange n distinct items in order — there are 5! = 120 orderings of five books on a shelf. Factorials grow ferociously fast, which is why they appear wherever you count arrangements: permutations, combinations, probability, and Taylor series.

n! = n × (n−1) × (n−2) × ⋯ × 2 × 1

with the convention 0! = 1; defined for whole numbers n ≥ 0

Worked example

Compute 5!:

  1. 1
    Write the descending product. 5! = 5 × 4 × 3 × 2 × 1.
  2. 2
    Multiply step by step. 5 × 4 = 20, then 20 × 3 = 60, then 60 × 2 = 120, then 120 × 1 = 120.
  3. 3
    Read the result. 5! = 120 — the number of ways to order five distinct books. Note 5! = 5 × 4!, since 4! = 24.

Factorials of small numbers

Each value is the previous one times n — they explode quickly.

nn!Expansion
01empty product
111
222 × 1
363 × 2 × 1
4244 × 3 × 2 × 1
51205 × 4 × 3 × 2 × 1
67206 × 5!
103,628,80010 × 9!

Why 0! = 1, and where factorials lead

0! = 1. There is exactly one way to arrange nothing — the empty arrangement — so 0! is defined as 1. This keeps the combination and permutation formulas working at the edges.

The recursive pattern. n! = n × (n−1)!, so each factorial is built from the one before it. That recurrence is how the tool computes large values exactly.

Building blocks for counting. Permutations are nPr = n! ÷ (n−r)! and combinations are nCr = n! ÷ (r! · (n−r)!) — both rest entirely on factorials.

Why stop at 170?
Beyond 170!, the value exceeds what a standard floating-point number can hold (≈1.8×10³⁰⁸). The exact integer is still computed for display.
Can factorials be negative or fractional?
The basic factorial is defined only for whole numbers. The gamma function extends it, but that is a separate calculation.
Where are factorials used?
Permutations, combinations, probability, Taylor series, and anywhere counting arrangements matters.
Why is 0! equal to 1?
There is exactly one way to arrange an empty set, and the convention keeps the combination and permutation formulas consistent.
How does n! relate to (n−1)!?
n! = n × (n−1)!. For example 5! = 5 × 4! = 5 × 24 = 120 — each factorial builds on the previous one.
What exactly does n! mean?
It is the product of every whole number from 1 up to n. For example 4! = 1 × 2 × 3 × 4 = 24.