Factorial Calculator
Calculate factorial (n!) of any integer up to 1000. Returns scientific notation for very large
What Is a Factorial?
A factorial is the product of all positive integers from 1 up to a given number, written with an exclamation mark. 5! (read "five factorial") means 5 times 4 times 3 times 2 times 1 = 120. Factorials grow extremely fast: 10! = 3,628,800 and 20! = 2,432,902,008,176,640,000. The concept is fundamental to combinatorics, probability, algebra, and calculus. Whenever you need to count the number of ways to arrange or choose items, factorials provide the mathematical foundation.
How to Calculate a Factorial?
Multiply the number by every positive integer below it down to 1. For example: 1! = 1. 2! = 2 times 1 = 2. 3! = 3 times 2 times 1 = 6. 4! = 24. 5! = 120. 6! = 720. 7! = 5,040. 8! = 40,320. 9! = 362,880. 10! = 3,628,800. By definition, 0! = 1 (not zero). This might seem strange, but it is mathematically necessary for combinatorial formulas to work correctly. Enter any number in the calculator above for an instant result, especially useful for large values where manual multiplication is impractical.
Why Does 0! Equal 1?
Zero factorial equals 1 by mathematical convention, and there are solid logical reasons. One explanation: there is exactly one way to arrange zero objects (do nothing). Another: the formula n! = n times (n-1)! requires 0! = 1 for consistency. If 1! = 1 times 0!, then 0! must be 1. The combinatorial formula for choosing k items from n (written as "n choose k") requires 0! = 1 to produce correct results. Without this definition, fundamental counting formulas would break at their boundary cases. Every branch of mathematics that uses factorials depends on 0! = 1.
Factorials in Permutations and Combinations
Permutations count the number of ways to arrange items where order matters. The number of ways to arrange n items is n!. Ten runners can finish a race in 10! = 3,628,800 different orderings. Combinations count selections where order does not matter. The number of ways to choose k items from n is n! / (k! times (n-k)!). Choosing 3 members from a 10-person team: 10! / (3! times 7!) = 120 possible groups. Lottery odds, poker hand probabilities, committee formations, and tournament brackets all use these factorial-based formulas.
Why Do Factorials Grow So Fast?
Factorials exhibit faster-than-exponential growth. While 2^10 = 1,024 and 10^2 = 100, the value 10! = 3,628,800 dwarfs both. By 20!, the number has 19 digits. By 100!, it has 158 digits. This explosive growth is why factorials appear in computing complexity theory: an algorithm that runs in factorial time becomes practically unsolvable for even moderately large inputs. The traveling salesman problem, which asks for the shortest route visiting n cities, has (n-1)!/2 possible routes. For just 20 cities, that is over 60 quadrillion routes to check. This growth rate is also why calculators overflow quickly with factorials. Most standard calculators cannot handle anything above about 170! because the result exceeds the maximum storable number.
Stirling Approximation
For very large factorials, exact computation is impractical. Stirling's approximation provides an estimate: n! is approximately the square root of (2 times pi times n) times (n/e)^n. This approximation becomes increasingly accurate as n grows. For n = 10, it gives 3,598,696 (within 0.8% of the true 3,628,800). For n = 100, the relative error drops below 0.1%. Scientists and engineers use Stirling's formula in statistical mechanics, information theory, and any field where factorials of large numbers appear in theoretical calculations. The approximation trades exact precision for the ability to work with numbers that would otherwise be computationally unwieldy.
What Are Double Factorials and Subfactorials?
The double factorial n!! multiplies every other integer down from n. 7!! = 7 times 5 times 3 times 1 = 105. 8!! = 8 times 6 times 4 times 2 = 384. It appears in certain integral formulas and physics equations. The subfactorial !n counts the number of derangements: arrangements where no item stays in its original position. !4 = 9, meaning there are 9 ways to rearrange four items so that none remains in place. This concept appears in probability problems like the hat-check problem, where guests randomly retrieve hats and you want to know the probability that nobody gets their own hat.
Frequently asked questions
What is 10 factorial?
Why does 0 factorial equal 1?
What is the factorial of a negative number?
What is the difference between permutation and combination?
How fast do factorials grow?
What is Stirling's approximation?
Rate This Calculator
Your feedback helps us improve our tools