Factorial Calculator
Calculate the factorial of any non-negative integer. Also computes permutations (nPr) and combinations (nCr).
Did this tool work for you?
How to use this calculator
Factorial multiplies all positive integers from 1 to n. Permutations count ordered arrangements; combinations count unordered selections.
- 1
Enter n (the main number).
- 2
Enter r to also calculate permutations nPr and combinations nCr.
- 3
Factorial of n gives the number of ways to arrange n distinct items.
- 4
P(n,r) counts ordered selections of r from n; C(n,r) counts unordered.
Frequently asked questions
What is 0! (zero factorial)?
0! = 1 by definition. This is not arbitrary — it makes combinatorial formulas work correctly. There is exactly one way to arrange zero items: do nothing.
What is the difference between permutation and combination?
Permutation (nPr) counts ordered arrangements: choosing 3 from 10 people for president, VP, and treasurer — order matters. Combination (nCr) counts unordered selections: choosing 3 from 10 people for a committee — order does not matter. C(10,3) = P(10,3)/3! = 120.
Why does factorial grow so fast?
Factorial is superexponential. 10! = 3,628,800. 20! ≈ 2.4 × 10¹⁸. 100! has 158 digits. This rapid growth is why brute-force solutions to combinatorial problems become infeasible — there are more ways to shuffle a deck of cards (52!) than atoms in the observable universe.
What is Stirling's approximation?
For large n, n! ≈ √(2πn) × (n/e)^n. This approximation is remarkably accurate and used in statistics, thermodynamics, and information theory when exact factorial values are too large to compute.
Factorials, permutations, and combinations explained
When to use permutations vs combinations
Ask: does order matter? Arranging books on a shelf — yes, order matters → permutation. Choosing a pizza topping subset — no, order does not matter → combination. The mnemonic: "Permutations are Placed in order; Combinations are Chosen without caring about order."
Factorials in probability
Factorial appears in binomial distributions: P(X=k) = C(n,k) × p^k × (1−p)^(n−k). It counts the number of ways k successes can occur in n trials. The birthday paradox, poker hand probabilities, and lottery odds all involve factorial calculations.
Real-world combinatorics
How many ways can 8 runners finish a race? 8! = 40,320. How many 5-card poker hands exist? C(52,5) = 2,598,960. How many ways to arrange letters in "MISSISSIPPI"? 11! / (4! × 4! × 2!) = 34,650 (accounting for repeated letters).
Learn more from an authoritative source:
WikipediaScientific Calculator
Evaluate mathematical expressions including trigonometry, logarithms, exponents, and more.
Percentage Calculator
Quickly calculate percentages, percentage change, and percentage of a total.
Fraction Calculator
Add, subtract, multiply, or divide two fractions and get the simplified result instantly.
Ratio Calculator
Simplify ratios, find missing values, and scale ratios up or down.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →