Factorial Calculator
Calculate the factorial of any non-negative integer. Enter a number to find its factorial (n!), which is the product of all positive integers less than or equal to n.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
A factorial calculator computes the product of all positive integers from 1 up to a given number n, denoted as n!. The calculation follows a simple multiplication pattern: n! = n × (n-1) × (n-2) × ... × 2 × 1. For any non-negative integer, this represents the number of ways to arrange n distinct objects in a sequence.
The factorial function has special cases that are important to understand. By mathematical definition, 0! = 1 and 1! = 1. These base cases ensure that factorial formulas work correctly in advanced mathematics, particularly in combinatorics and probability theory. The factorial grows extremely rapidly - while 10! = 3,628,800, just 13! exceeds 6 billion.
Factorial calculations are fundamental in many areas of mathematics. In combinatorics, n! represents the number of permutations of n distinct objects. In probability theory, factorials appear in calculating odds and distributions. The factorial function also appears in calculus through Taylor series expansions and in number theory through various mathematical proofs and identities.
When To Use This
Right tool, right situation
Use factorial calculations when determining the number of ways to arrange objects in a specific order. This is common in probability problems, such as calculating the odds of specific card arrangements or determining how many ways students can be seated in a classroom.
Factorials are essential in combinatorics problems involving permutations and combinations. When order matters (like race finishing positions), use factorial-based permutation formulas. When order doesn't matter (like choosing team members), use combination formulas that involve factorials in both numerator and denominator.
In advanced mathematics, factorials appear in Taylor series expansions, statistical distributions, and number theory. They're also used in computer science for analyzing algorithm complexity and in physics for statistical mechanics calculations involving particle arrangements and energy states.
Common Mistakes
Why results sometimes look wrong
A common mistake is forgetting that 0! = 1, not 0. This special case often confuses students, but it's essential for mathematical consistency. Another frequent error is attempting to calculate factorials of negative numbers, which are undefined in standard mathematics.
Many people underestimate how quickly factorials grow. While 5! = 120 seems manageable, 20! already exceeds 2 quintillion. This rapid growth means that factorial calculations become computationally challenging for large numbers, and most programming languages have upper limits for accurate factorial computation.
When using factorials in probability problems, students sometimes confuse permutations with combinations. Remember that n! gives the total arrangements of n objects, while combinations require dividing by the factorial of objects being chosen. Always double-check whether order matters in your specific problem before applying factorial formulas.
The Math
Worked examples and deeper derivation
The mathematical definition of factorial is: n! = n × (n-1) × (n-2) × ... × 2 × 1 for any positive integer n, with the special cases 0! = 1 and 1! = 1. This can also be expressed recursively as n! = n × (n-1)! where n > 0.
Factorials grow at an extraordinary rate, much faster than exponential functions. This rapid growth makes factorial calculations useful in estimating very large numbers of arrangements or combinations. The factorial function is closely related to the gamma function, where n! = Γ(n+1) for non-negative integers, extending the concept to non-integer values.
In combinatorics, factorials are essential for calculating permutations and combinations. The number of ways to choose r objects from n objects is given by the combination formula C(n,r) = n! / (r!(n-r)!). Similarly, the number of arrangements of r objects chosen from n objects is P(n,r) = n! / (n-r)!.
Common questions
Need something this doesn't cover?
Suggest a tool — we'll build it →