Connect via MCP →

Enter Calculation

Enter a non-negative whole number (0 to 170).

Formula

Advertisement

Results

5! equals
120
factorial of 5
Input (n) 5
n! 120

What Is a Factorial?

The factorial of a non-negative integer n, written n!, is the product of every positive integer from 1 up to n. For example, \(5! = 1 \times 2 \times 3 \times 4 \times 5 = 120\). By mathematical convention, \(0! = 1\) (the empty product). Factorials grow extremely fast — 10! is already over three million — so this calculator supports values from 0 up to 170, the largest factorial that fits in a standard double-precision number.

Diagram showing a factorial as the product of descending whole numbers
A factorial multiplies every whole number from n down to 1.

How to Use the Calculator

Enter a whole number n between 0 and 170 and the tool instantly returns n!. There is nothing else to configure: factorials are defined only for non-negative integers, so any decimals or negatives are not accepted. The result panel shows the full computed value of n!.

The Formula Explained

Mathematically, $$\text{n}! = \prod_{i=1}^{\text{n}} i = 1 \times 2 \times 3 \times \cdots \times \text{n}$$ It can also be written recursively as \(n! = n \times (n - 1)!\), with the base case \(0! = 1\). Each step simply multiplies the running product by the next integer. Factorials count the number of ways to arrange n distinct objects in order (permutations), which is why they appear throughout combinatorics, probability, and series expansions.

Advertisement
Bar chart showing how factorial values grow rapidly
Factorial values grow extremely fast as n increases.

Worked Example

To find 6!, multiply step by step: \(1 \times 2 = 2\), \(\times 3 = 6\), \(\times 4 = 24\), \(\times 5 = 120\), \(\times 6 = 720\). So $$6! = 720$$ This means there are 720 different ways to order six distinct items.

FAQ

Why is 0! equal to 1? The factorial counts permutations, and there is exactly one way to arrange zero objects (the empty arrangement). It also keeps formulas like nCr consistent.

Can I compute the factorial of a decimal? Not with the basic factorial. Extending factorials to non-integers requires the Gamma function, which this calculator does not cover.

Why stop at 170? \(170! \approx 7.26 \times 10^{306}\) is the largest factorial below the maximum value a double-precision floating-point number can hold; 171! overflows to infinity.

Last updated: