Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Calculate n! (n factorial) for any non-negative integer.
120
The factorial of a non-negative integer n (written n!) is the product of all positive integers from 1 up to n. It's the foundation of permutations and combinations.
Enter a non-negative integer. The factorial appears instantly.
n! = n × (n-1) × (n-2) × ... × 1
By convention, 0! = 1.
Factorials grow far faster than most people expect. 5! is only 120 and 10! is 3,628,800, but 20! already exceeds two quintillion, and 170! is a number with more than 300 digits. This explosive growth is the reason factorials describe the number of possible orderings of a set: every extra item multiplies the total by the new item count. Ten books on a shelf can be arranged in 3,628,800 different orders, and adding just one more book multiplies that by 11.
The calculator multiplies the whole numbers from 2 up to n, so it needs n to be a non-negative whole number. Decimals such as 4.5 and negative numbers such as -3 are rejected, because the ordinary factorial is not defined for them. Entering 0 or 1 both give 1.
The tool computes factorials with exact integers, so every digit is correct: 20! is 2,432,902,008,176,640,000 and 25! is 15,511,210,043,330,985,984,000,000. Results up to 40 digits are written in full; longer ones (from 35!) are shown in scientific notation with the exact leading digits. The tool stops at 170!, the largest factorial that still fits in an ordinary double-precision number, so 171 and above show no result.
How many ways can 6 hypothetical runners finish a race, ignoring ties? Every finishing order is an arrangement of all six runners, so the count is 6!.
6! = 6 × 5 × 4 × 3 × 2 × 1 = 720
There are 720 possible finishing orders. If you add a seventh runner, the count becomes 7! = 5,040, which is 7 times as many.
Factorials often appear in fractions, and you can save effort by cancelling common terms instead of computing both huge values. For example, 10! / 8! equals 10 × 9 = 90, because everything from 8 downward cancels. This is exactly how permutations and combinations are calculated efficiently, so it is a good habit when working problems by hand. You can then use the calculator to check the value of a single factorial.
Factorials appear whenever you count orderings: seating arrangements, scheduling tasks, shuffling a deck, or the number of routes visiting a set of cities once. They are also part of the series expansions of functions in calculus and appear in probability formulas for the binomial and Poisson distributions.
It's a mathematical convention that keeps formulas like permutations and combinations consistent -- there's exactly one way to arrange zero items (doing nothing).
Up to 170! -- beyond that, the result exceeds the range standard double-precision numbers can represent accurately.
They're the building block of permutations and combinations -- see the Permutation Calculator and Combination Calculator.
Not with this tool. It accepts only whole numbers zero or greater. Extensions of the factorial to decimals exist in higher mathematics, but they are a separate function and are not computed here.
Yes. The calculator uses exact integer arithmetic up to 170!. Results longer than 40 digits are displayed in scientific notation, but the leading digits shown are exact.
There are n! ways. For 4 different items that is 4! = 24 arrangements. If some items are identical, divide by the factorial of each group of identical items.
Multiply the smaller factorial by n. Since 6! = 720, then 7! = 7 × 720 = 5,040.
Reference: NIST Weights and Measures