Factorial Calculator
Part of Math & Statistics Calculators
Calculate factorials (n!) with detailed step-by-step multiplication for any non-negative integer.
How to Use This Factorial Calculator
- Enter a non-negative integer: Input any whole number from 0 upward. Factorials are only defined for non-negative integers (0, 1, 2, 3, ...).
- Calculate: Click "Calculate Factorial" to compute n! (n factorial).
- View the result: See the factorial value displayed in both standard notation and scientific notation for large numbers.
- Review steps: For smaller factorials (n ≤ 20), see the complete step-by-step multiplication process showing how the result is calculated.
What is a Factorial?
The factorial of a non-negative integer n, denoted as n!, is the product of all positive integers less than or equal to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. Factorials grow extremely rapidly - 10! is already over 3 million, and 20! exceeds 2 quintillion.
Factorials are fundamental in combinatorics, probability theory, calculus, and algebra. They count the number of ways to arrange n distinct objects in order (permutations), appear in the formulas for combinations, and are essential in Taylor series expansions and probability distributions.
Factorial Rules and Properties
Zero factorial: 0! = 1 by definition. This may seem counterintuitive, but it makes mathematical formulas work consistently, particularly in combinatorics where there is exactly one way to arrange zero objects (do nothing).
One factorial: 1! = 1. There is only one way to arrange a single object.
Recursive definition: n! = n × (n-1)! for n > 0. Each factorial builds on the previous one. For example, 6! = 6 × 5! = 6 × 120 = 720.
Growth rate: Factorials grow faster than exponential functions. While 2^n grows exponentially, n! grows super-exponentially, quickly becoming astronomical in size.
Common Factorial Values
Here are some factorial values to remember: 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, 7! = 5,040, 8! = 40,320, 9! = 362,880, 10! = 3,628,800.
Beyond 10!, factorials become very large very quickly: 15! = 1,307,674,368,000 (over 1 trillion), 20! = 2,432,902,008,176,640,000 (over 2 quintillion), and 25! has 26 digits. This rapid growth limits the usefulness of computing very large factorials directly.
Applications of Factorials
Permutations: The number of ways to arrange n distinct objects is n!. For example, 3 books can be arranged on a shelf in 3! = 6 different ways.
Combinations: The number of ways to choose k objects from n is C(n,k) = n! / (k! × (n-k)!). This formula uses factorials to calculate lottery odds, poker hands, and committee selections.
Probability: Factorials appear in probability distributions like the Poisson and binomial distributions, which model everything from radioactive decay to quality control.
Calculus: Taylor series and Maclaurin series use factorials in their expansion formulas, allowing complex functions to be approximated by polynomials.
Factorial Notation and Extensions
The factorial symbol (!) was introduced by Christian Kramp in 1808. For non-integer values, the factorial concept extends to the gamma function: Γ(n) = (n-1)! for positive integers. The gamma function allows "factorials" of non-integers and is fundamental in advanced mathematics and physics.
Double factorials (n!!) multiply every other number: 8!! = 8 × 6 × 4 × 2 = 384. Subfactorials (!n) count derangements - permutations where no element appears in its original position. These variations solve specific counting problems in combinatorics.
Computational Considerations
Computing large factorials requires careful handling. Standard integer types overflow quickly - even 64-bit integers can't hold 21!. Floating-point approximations work for larger values but lose precision. For very large factorials, Stirling's approximation provides an excellent estimate: n! ≈ √(2πn) × (n/e)^n. This approximation becomes more accurate as n increases and is invaluable in theoretical analysis.
Factorials are used in permutation and combination calculations. For probability problems, also see the Probability Calculator.