This calculator counts the number of ways to choose or arrange items — the core of combinatorics and probability. It handles three operations: combinations (nCr) where order does not matter, permutations (nPr) where it does, and plain factorials (n!). It is useful for lottery odds, password-strength sums, statistics homework and any “how many ways” question.
How it works
The three modes use standard combinatorial formulas:
- Factorial:
n! = n × (n−1) × … × 2 × 1, the number of orderings of n items. - Permutations:
nPr = n! ÷ (n − r)!, computed iteratively asn × (n−1) × … × (n−r+1)to avoid overflow. - Combinations:
nCr = n! ÷ [r! × (n − r)!], computed step by step (using the smaller of r and n−r) so larger inputs stay accurate.
Because order matters in permutations but not in combinations, nPr is always at least as large as nCr for the same n and r.
Example
Choosing 3 items from 10:
nCr(10, 3) = 10! ÷ (3! × 7!) = 120 nPr(10, 3) = 10 × 9 × 8 = 720
So there are 120 unordered selections but 720 ordered arrangements — the permutation count is 3! = 6 times larger, because each combination can be ordered in 6 ways.
Choose a mode, enter your values for n and r, and the result appears instantly — all computed locally in your browser with nothing uploaded.