Factorial Calculator
Calculate the factorial of any whole number (n!) instantly, with a step-by-step product chain and a quick-reference table of small factorials.
Calculate the factorial of any whole number (n!) instantly, with a step-by-step product chain and a quick-reference table of small factorials.
The factorial of a number n (written n!) is the product of all positive integers from 1 up to n. Factorials appear constantly in combinatorics, probability, and algebra — for example, counting how many ways a set of items can be arranged.
Where factorials are used
Permutations (arranging n items: n! ways), combinations (n! ÷ (r! × (n−r)!)), probability calculations, Taylor series in calculus, and counting problems in computer science all rely on factorials.
How many ways can 8 people sit at a table? 8! answers seating, playlists, and race orders.
Permutations and combinations are built on factorials — get the big numbers right.
See how quickly arrangements explode — why shuffled decks and passphrases are so hard to guess.
Estimate the search space of puzzles and games before brute-forcing them.
52! is roughly 8×10⁶⁷. A properly shuffled deck has almost certainly never appeared in that exact order before anywhere in history.
Ten guests around a round table can be arranged 362,880 ways once one seat is fixed. It explains why the wedding seating chart took a whole evening.
The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 to n: n! = n × (n−1) × (n−2) × … × 2 × 1. Examples: 0! = 1 (by convention); 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. The 0!=1 convention is not arbitrary — it makes the combinatorics formulas work correctly for edge cases like "choose 0 from n."
Factorials appear throughout mathematics and science: Permutations — the number of ways to arrange n distinct objects in order is n! (e.g. 5 books on a shelf = 5! = 120 arrangements). Combinations — choosing r items from n: C(n,r) = n! ÷ (r! × (n−r)!). Probability — poker hand probabilities use C(52,5) = 52!/(5!×47!). Calculus — Taylor series: eˣ = 1 + x + x²/2! + x³/3! + … Physics — Stirling's approximation (ln n! ≈ n ln n − n) is used in statistical mechanics and thermodynamics.
Factorials are a product of increasing multipliers, so they grow superexponentially — faster than any exponential function like 2ⁿ. Quick scale reference: 10! ≈ 3.6 million; 15! ≈ 1.3 trillion; 20! ≈ 2.4 × 10¹⁸; 25! ≈ 1.6 × 10²⁵; 52! ≈ 8 × 10⁶⁷ (the number of ways to shuffle a deck of cards — more than the estimated number of atoms in the observable universe, which is ~10⁸⁰). This explosive growth is why even 100! (about 9.3 × 10¹⁵⁷) requires arbitrary-precision arithmetic to represent exactly.
Permutations count ordered arrangements; combinations count unordered selections. Permutations (order matters): P(n,r) = n! ÷ (n−r)!. Example: arranging 3 of 5 letters = P(5,3) = 5!/2! = 60. Combinations (order does not matter): C(n,r) = n! ÷ (r! × (n−r)!). Example: choosing 3 from 5 = C(5,3) = 5!/(3!×2!) = 10. The relationship: C(n,r) = P(n,r) ÷ r! — since each combination corresponds to r! permutations of the same items. Lottery odds use combinations: C(49,6) = 49!/(6!×43!) ≈ 14 million (why winning is so rare).
Factorials are only defined for non-negative integers, but the Gamma function Γ(n) extends the concept to real and complex numbers: Γ(n) = (n−1)! for positive integers, and Γ(1/2) = √π ≈ 1.772. This means you can compute "half-factorial": (1/2)! = Γ(3/2) = √π/2 ≈ 0.886. The Gamma function appears in probability distributions (chi-squared, beta, Student's t), physics (quantum mechanics, statistical mechanics), and complex analysis. It is one of the most important functions in advanced mathematics.