Factorial Calculator

n! — the product of all whole numbers from 1 to n, exactly.

Factorial Calculator

Worked example result
n! (exact value)120
Number of digits3

5! = 1 × 2 × 3 × 4 × 5 = 120 — which is why 5 different books can be arranged on a shelf in exactly 120 different orders.

The factorial of n, written n!, is the product 1 × 2 × 3 × … × n. Factorials count arrangements: 5! = 120 is the number of ways to order 5 distinct items in a line.

Factorials grow astonishingly fast — 20! already exceeds 2 quintillion, and this calculator is capped at 170!, a 307-digit number. Results are calculated exactly with big-integer arithmetic and shown in full, not rounded.

The formula

n! = 1 × 2 × 3 × … × n, with 0! = 1 by definition

Worked example

5! = 1 × 2 × 3 × 4 × 5 = 120 — which is why 5 different books can be arranged on a shelf in exactly 120 different orders.

The example is pre-loaded in the result panel — press Calculate with your own numbers to replace it.

Frequently asked questions

Why is 0! equal to 1?

By definition, and it makes the counting formulas work: there is exactly one way to arrange zero items (do nothing). It also follows the pattern n! ÷ n = (n−1)! — 1! ÷ 1 = 1, so 0! = 1.

Where are factorials used?

In permutations and combinations (lottery odds, card shuffles), probability, and the Taylor series in calculus. A shuffled deck has 52! ≈ 8 × 10^67 possible orders — more than atoms in the galaxy.

Why stop at 170?

170! ≈ 7.26 × 10^306 is close to the largest number standard floating-point arithmetic can hold (about 1.8 × 10^308); 171! overflows it. The exact digits are still shown in full here.

Category: Math calculators