Skip to content
ToolsLeb ToolsLeb

Factorial Calculator

Calculate the factorial of a number (n!).

Simple Math

Calculator Inputs

Your Result

Enter your details and press Calculate to see your result.

Formula

Factorial = Factorial(Number (n))
Number (n) n! = n × (n-1) × (n-2) × ... × 1. Capped at 500 for a readable result.

How it works

  1. Enter a whole number.
  2. View its factorial (n!).

Share on Social Media:

The factorial of a whole number n, written n!, is the product of every whole number from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Enter any whole number from 0 to 500 and this calculator returns the exact result, every digit included, using arbitrary-precision arithmetic, so large factorials don't lose accuracy.

Definition

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

0! = 1 because there is exactly one way to arrange zero objects: do nothing. It also keeps formulas like n! = n × (n − 1)! consistent when n = 1.

Examples

nn!
01
5120
103,628,800
136,227,020,800
202,432,902,008,176,640,000

Factorials grow faster than exponential functions. 52! (the number of ways to shuffle a deck of cards) has 68 digits, and 500! has 1,135 digits.

Where factorials are used

  • Arrangements: 5 people can stand in a line in 5! = 120 different orders.
  • Permutations and combinations: nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! × (n − r)!). See the Permutation Calculator and Combination Calculator.
  • Probability: the chance of a random shuffle putting 10 items in one exact order is 1 in 10! = 1 in 3,628,800.
  • Calculus: Taylor series, such as eˣ = 1 + x + x²/2! + x³/3! + …

Why the limit is 500?

Results are calculated exactly, not rounded to floating-point numbers. A normal calculator switches to scientific notation after about 13! and can't show factorials above 170! at all. The 500 cap keeps the full result readable on the page. Factorials are only defined here for non-negative whole numbers; the gamma function extends the idea to fractions.

Frequently Asked Questions

The factorial of n (written n!) is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1.

By mathematical convention, 0! = 1 — it's defined this way so formulas like permutations and combinations work correctly at the boundary case of choosing zero items.

Extremely fast — 10! is already 3,628,800, and 20! is over 2.4 quintillion. This rapid growth is why factorials show up in combinatorics problems where the number of arrangements explodes quickly.

Standard factorial is only defined for non-negative integers. For non-integer values, the Gamma function extends the concept, but that's a different, more advanced calculation than this tool performs.