Calculate permutations (nPr) and combinations (nCr) instantly. Enter n and r values to get results with step-by-step explanations. Free, fast, and client-side.
This calculator computes permutations (nPr) and combinations (nCr) for given values of n (total items) and r (selected items). Permutations count arrangements where order matters; combinations count selections where order does not matter. These concepts are fundamental in probability, statistics, combinatorics, and everyday decision-making. All calculations happen instantly in your browser.
Permutation (nPr) counts arrangements where the order matters. For example, ABC is different from BAC. Combination (nCr) counts selections where order does not matter — ABC and BAC are the same combination. Use permutations for ordered arrangements (lock codes, race rankings) and combinations for unordered selections (lottery, team choosing).
n is the total number of items in the set. r is the number of items you are selecting from that set. For example, if you have 10 books and want to pick 3 for a trip, n=10 and r=3.
Factorials grow extremely fast. 170! is approximately 7.26 × 10³⁰⁶, which is near the maximum value JavaScript can represent. Beyond this, results would lose precision.
They are used everywhere: probability theory (card games, dice), statistics (sampling), computer science (algorithm complexity), cryptography (key spaces), genetics (gene combinations), sports (tournament brackets), and everyday decisions (menu combinations, password strength).