Skip to content
Calc.

Factorial Calculator

Calculates n!, the product of all whole numbers from 1 to n, for n from 0 to 169, and explains how factorials count arrangements and combinations.

Last updated: October 2026

Factorial

120

Formula below · 3 sources (oeis.org, mathworld.wolfram.com, britannica.com) · Updated Oct 2026

Compare with similar

About this calculator

The factorial of a whole number n, written n!, is the product of all whole numbers from 1 to n:

n! = n × (n − 1) × … × 2 × 1, and 0! = 1

0! is 1 because it is an empty product, and because it keeps formulas such as C(n, n) = n! ÷ (n! × 0!) = 1 correct.

What factorials count

n! is the number of ways to put n different things in order: 5 books can stand on a shelf in 5! = 120 orders. Factorials also build the counts of permutations, P(n, k) = n! ÷ (n − k)!, and combinations, C(n, k) = n! ÷ [k! (n − k)!].

How big they get

Factorials grow faster than any exponential: 10! = 3,628,800 and 20! is about 2.4 × 10¹⁸. 170! (about 7.3 × 10³⁰⁶) is the largest factorial that fits in a standard double-precision number at all; this calculator goes up to 169! (about 4.3 × 10³⁰⁴), because rounding the result for display needs a little headroom. Results of a trillion or more are shown in scientific notation with four significant digits. For non-integers, the gamma function extends the factorial: Γ(n + 1) = n!.

How to use

Enter a whole number from 0 to 169. Default: 5! = 1 × 2 × 3 × 4 × 5 = 120. 7! = 7 × 6! = 7 × 720 = 5,040. 0! = 1. 20! = 2,432,902,008,176,640,000, shown as 2.433 × 10¹⁸.

Frequently asked questions

Why is 0! equal to 1?

Multiplying no numbers together gives 1, the empty product. It also makes counting formulas work: there is exactly one way to arrange nothing, and C(n, n) = n! ÷ (n! × 0!) must equal 1.

Why does the calculator stop at 169?

Factorials soon exceed what ordinary floating-point numbers can store: 171! is larger than about 1.8 × 10³⁰⁸, the largest double-precision value, and 170! leaves no room for the rounding this page applies. Exact values beyond that need arbitrary-precision arithmetic.

Can I take the factorial of a negative number or a fraction?

Not with the ordinary factorial, which is defined for whole numbers 0 and up. The gamma function extends it to other values: Γ(n + 1) = n!, and for example (1/2)! = √π ÷ 2.

What is the difference between a permutation and a combination?

A permutation counts ordered arrangements, P(n, k) = n! ÷ (n − k)!. A combination counts unordered selections, C(n, k) = n! ÷ [k! (n − k)!]. Choosing 2 of 7 people for president and treasurer gives 42 ways; choosing a 2-person committee gives 21.

Related calculators

Sources & references

How we check our calculators

Think a result is wrong? Report a problem with this calculator.