Sprint 8 Converter + Math
Factorial Calculator
n! for non-negative integer n.
n!
3628800
How it works
The factorial of a non-negative integer n (written n!) is the product of all positive integers from 1 to n. Factorials appear throughout combinatorics, probability, calculus (Taylor series), and computer science (algorithm complexity analysis). They grow extraordinarily fast: 13! exceeds the range of 32-bit integers, and 21! exceeds 64-bit integers — making arbitrary-precision arithmetic essential for large inputs.
**Definition** n! = n × (n−1) × (n−2) × ... × 2 × 1 By convention: 0! = 1 (this makes combinatorial formulas work consistently)
**Growth rate** - 5! = 120 - 10! = 3,628,800 - 20! = 2,432,902,008,176,640,000 (≈ 2.43 × 10¹⁸) - 100! ≈ 9.33 × 10¹⁵⁷ (157-digit number)
**Stirling's approximation** For large n: n! ≈ √(2πn) × (n/e)ⁿ. This approximation is accurate to within 1% for n ≥ 10 and is used in statistical mechanics and thermodynamic entropy calculations.
**Combinatorics applications** - Number of ways to arrange n objects: n! (permutations) - Number of ways to choose k objects from n without regard to order: C(n,k) = n! / (k! × (n−k)!) — the binomial coefficient - Number of ways to arrange n objects with k repetitions: n! / (n₁! × n₂! × ... × nₖ!) — multinomial coefficient
**Gamma function extension** The factorial is extended to non-integers via the Gamma function: Γ(n+1) = n!. This allows "factorial" of 0.5: Γ(1.5) = (1/2)! = √π/2 ≈ 0.886. The calculator handles positive integers up to 10,000+ using arbitrary-precision arithmetic.
Privacy: all calculations run in the browser. No data is transmitted.
Frequently Asked Questions
- 0! = 1 by convention, chosen to make combinatorial formulas work consistently. The number of ways to arrange 0 objects is 1 (there's exactly one way to arrange nothing — do nothing). Combinatorially: C(n,0) = n! / (0! × n!) = 1, which is correct (there's exactly one way to choose zero objects from any set). If 0! = 0, then all binomial coefficients C(n,0) would be undefined. The recursive definition also works: (n+1)! = (n+1) × n! → for n=0: 1! = 1 × 0! → 0! = 1.
- Factorials grow super-exponentially. 13! = 6,227,020,800 exceeds a 32-bit integer max (2,147,483,647). 21! exceeds a 64-bit integer (9.22 × 10¹⁸). 170! ≈ 7.26 × 10³⁰⁶ is the largest factorial representable in IEEE 754 double precision; 171! overflows to infinity. For exact large factorials, arbitrary-precision integer arithmetic is required. The calculator uses BigInt to handle inputs up to thousands.
- Permutations: the number of ways to arrange n distinct objects = n!. There are 8! = 40,320 ways to arrange 8 chess pieces on 8 squares. Combinations: C(52,5) = 52!/(5!×47!) = 2,598,960 possible 5-card poker hands. Probability distributions: the Poisson, binomial, and normal distributions all involve factorial terms. Physics: partition functions in statistical mechanics, Taylor series (eˣ = Σxⁿ/n!), and quantum state counting use factorials extensively.
- Stirling's approximation: n! ≈ √(2πn) × (n/e)ⁿ. Taking the natural log: ln(n!) ≈ n×ln(n) − n + ½×ln(2πn). This is accurate to within 1% for n ≥ 10 and within 0.1% for n ≥ 100. It is essential in statistical mechanics (Boltzmann entropy formula S = k_B × ln(Ω) involves ln(N!) for N ≈ 10²³ particles — only Stirling's approximation makes this tractable), information theory, and asymptotic algorithm analysis.