Factorial Calculator (n!) Studio
Step-by-Step Breakdown • Expressions Solver • Permutations & Combinations
Factorial & Expression Solver
Calculate exact factorials, solve equations (e.g. 5! + 3! or 10!/5!), or use the slider
Step-by-Step Multiplication
Mathematical Presets & Benchmarks
Quickly load specific mathematical constants, arrangements, and combinatorics limits
Arrangements (nPr) & Selections (nCr)
Calculate probabilities, permutations, and choices using optimized overflow-proof algorithms
Stirling's Approximation Studio
Estimate giant factorials up to 10,000! and track mathematical error tolerances
Error Matrix (Exact vs Stirling)
| Target Factorial: | 5! |
| Exact Value: | 120 |
| Stirling's Estimate: | 1.180 × 10^2 |
| Absolute Error: | 1.98 |
| Relative Margin: | 1.6500% |
Recent Tape Calculations
Factorial Reference Chart (0! to 20! Quick Guide)
Instant numerical guides, digit counts, and landmark associations from 0! to 20!
A factorial, written as n!, is the product of all positive integers from 1 up to and including n. By mathematical convention, 0! = 1 because there is exactly one way to arrange zero items — the empty arrangement. Factorials grow extremely rapidly: 10! is already 3,628,800, while 20! exceeds 2.4 quintillion (2,432,902,008,176,640,000). This explosive growth makes factorials central to probability theory, combinatorics, and algorithm complexity.
| n | n! (Factorial Value) | Digit Count | Common Association |
|---|---|---|---|
| 0 | 1 | 1 | Empty set permutation (by definition) |
| 1 | 1 | 1 | Single element — only one arrangement |
| 2 | 2 | 1 | Two items: AB or BA |
| 3 | 6 | 1 | RGB colour orderings |
| 4 | 24 | 2 | Card suit orderings |
| 5 | 120 | 3 | 5-character PIN permutations |
| 6 | 720 | 3 | Chess piece movement orderings |
| 7 | 5,040 | 4 | Days-of-week arrangement count |
| 8 | 40,320 | 5 | Rubik's Cube corner arrangements |
| 9 | 362,880 | 6 | Sudoku digit arrangements |
| 10 | 3,628,800 | 7 | 10-player team lineup permutations |
| 11 | 39,916,800 | 8 | 11-player football formation orders |
| 12 | 479,001,600 | 9 | 12-month calendar arrangement count |
| 13 | 6,227,020,800 | 10 | Standard deck suit orderings (partial) |
| 14 | 87,178,291,200 | 11 | Cryptographic key space baseline |
| 15 | 1,307,674,368,000 | 13 | Tournament bracket permutations |
| 16 | 20,922,789,888,000 | 14 | 16-bit register state orderings |
| 17 | 355,687,428,096,000 | 15 | Genome sequencing combinatorics |
| 18 | 6,402,373,705,728,000 | 16 | Chessboard piece placements |
| 19 | 121,645,100,408,832,000 | 18 | Protein folding sequence counts |
| 20 | 2,432,902,008,176,640,000 | 19 | Upper limit for 64-bit integer storage |
Real-World Applications of Factorials
How factorial mathematics powers cryptography, algorithm design, probability modeling, and modern scientific computing.
Permutations — Ordered Arrangements
A permutation counts the number of ways to arrange k items selected from n distinct objects where order matters. The formula is P(n, k) = n! ÷ (n − k)!. If a race has 10 competitors and you want to know how many possible 1st-2nd-3rd podium combinations exist, that is P(10, 3) = 10! ÷ 7! = 720. Permutations appear in cryptography (counting possible password sequences), scheduling (task ordering in operating systems), and genetics (counting codon sequence arrangements in RNA).
Combinations — Unordered Selections
A combination counts the number of ways to choose k items from n objects where order does not matter. The formula is C(n, k) = n! ÷ (k! × (n − k)!), also written as "n choose k". Selecting 5 lottery numbers from 49 gives C(49, 5) = 1,906,884 possible tickets. Combinations appear in probability distributions (binomial theorem), card game hand counting, and statistical sampling design where only which items are selected matters, not their sequence.
Taylor Series & Calculus
Factorials appear as denominators in Taylor series expansions, which approximate mathematical functions as infinite polynomials. The exponential function e^x equals the sum of x^n ÷ n! for n from 0 to infinity. The sine and cosine functions, natural logarithm, and virtually every transcendental function used in physics and engineering is computed via factorial-denominator Taylor series internally by calculators and programming language math libraries.
Computer Science — Algorithm Complexity
Factorial time complexity, written O(n!), is the worst-case growth rate of brute-force algorithms that enumerate every possible permutation of the input. The Travelling Salesman Problem (finding the shortest route visiting n cities) has O(n!) naive complexity because checking every possible route ordering requires n! iterations. For n = 15 cities, that is over 1.3 trillion route checks — illustrating why heuristic algorithms are necessary for even modest problem sizes. Understanding factorial growth is essential for algorithm design and NP-hard problem analysis.
Probability — Binomial Distribution
The binomial distribution, which models the probability of getting exactly k successes in n independent trials (such as coin flips or quality control pass/fail tests), uses the combination formula C(n, k) directly. Calculating the probability that exactly 3 out of 10 components fail a stress test uses 10! in its numerator. Epidemiologists use factorial-based formulas to model disease spread probabilities, clinical trial statisticians use them for significance testing, and insurance actuaries use them for mortality rate modelling.
Overview & Capabilities
Compute exact mathematical factorials (\(n!\)), double factorials (\(n!!\)), permutations (\(nPr\)), and combinations (\(nCr\)) with our Factorial Calculator! Powered by arbitrary-precision BigInt arithmetic, our tool computes exact multi-thousand-digit integers without floating-point overflow or scientific rounding errors.
How to Use
Key Features
Common Use Cases
Tips & Best Practices
Frequently Asked Questions
Q What is a Factorial (n!)?
The factorial of a non-negative integer n is the product of all positive integers less than or equal to n: n! = n × (n - 1) × (n - 2) × ... × 2 × 1. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.
Q Why is 0! equal to 1?
0! = 1 by mathematical definition to preserve recursive identities like n! = n × (n - 1)!, which for n = 1 gives 1! = 1 × 0!, requiring 0! = 1. Combinatorially, there is exactly 1 way to arrange an empty set of zero items.
Q How do you count trailing zeros in a factorial using Legendre's Formula?
Trailing zeros are formed by pairs of 2s and 5s (since 2 × 5 = 10). Because factors of 2 are abundant, count factors of 5: Zeros = floor(n/5) + floor(n/25) + floor(n/125) + ... For 100!: floor(100/5) + floor(100/25) = 20 + 4 = 24 trailing zeros.



