Count permutations and combinations
How many ways to pick a committee, draw cards, or assign ranks — nPr, nCr, and nHr computed as exact integers.
Tools used in this guide
The job
“How many 5-card hands from a deck?” “How many ways to rank the top 3 of 20 contestants?” Counting problems split on one question: does the order of picks matter, and can the same item be picked twice?
How to do it
Pick the operation first — the formula label shows which one — then enter n (how many items exist) and k (how many you take). The result is an exact integer with its digit count.
- nPr — order matters, no repeats: podium finishes, PINs without reuse.
- nCr — order does not matter, no repeats: committees, card hands, lottery picks.
- nHr — order does not matter, repeats allowed: distributing identical items into boxes, choosing snacks when the store restocks.
Worked example
A 5-card poker hand from 52 cards is C(52, 5) = 2,598,960. Ranking gold–silver–bronze among 20 athletes is P(20, 3) = 6,840. Picking 3 donuts from 6 kinds with restocking is H(6, 3) = 56.
Limits
Inputs up to 5,000, computed with exact BigInt math — C(5000, 2500) prints all ~1,500 digits and never rounds. k cannot exceed n for nPr/nCr (there is no way to pick more distinct items than exist); nHr allows it as long as n+k−1 stays under 10,000. Overflows are impossible; absurdly large outputs are the only cost.