🧮

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.

Loading…

Frequently Asked Questions

What is a factorial and how is it calculated?

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."

What are the main real-world applications of factorials?

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.

Why do factorials grow so fast?

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.

What is the connection between factorials and permutations vs. combinations?

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).

What is the gamma function and how does it extend factorials?

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.