Permutation & Combination Calculator
Calculate permutations (nPr) and combinations (nCr) for choosing r items from n. Shows the factorial formulas and handles large values without overflow.
Permutations (nPr) โ order matters
720
10P3 = n! / (n โ r)!
Combinations (nCr) โ order ignored
120
10C3 = n! / (r!(n โ r)!)
Use permutations when arrangements differ by order (a race podium) and combinations when they do not (a committee). Each combination corresponds to r! permutations.
Frequently Asked Questions
What is the difference between a permutation and a combination?
A permutation counts arrangements where order matters (1st, 2nd, 3rd place), while a combination counts selections where order does not matter (a committee of three). Because each combination can be arranged in r! ways, nPr is always at least as large as nCr.
How do I calculate nPr?
Use nPr = n! / (n โ r)!, the number of ordered arrangements of r items chosen from n. For example, the number of ways to award gold, silver, and bronze to 8 runners is 8P3 = 8 ร 7 ร 6 = 336.
How do I calculate nCr?
Use nCr = n! / (r!(n โ r)!), the number of unordered selections of r items from n. For example, the number of 5-card poker hands from a 52-card deck is 52C5 = 2,598,960.
What is the factorial in these formulas?
n! (n factorial) is the product of all whole numbers from 1 to n, so 5! = 5 ร 4 ร 3 ร 2 ร 1 = 120. It counts the number of ways to arrange n distinct items, and 0! is defined as 1.
How does the calculator handle large numbers?
Combinations are computed with a stable product-and-divide loop instead of full factorials, so it avoids overflow for moderate inputs. Very large results that exceed JavaScript's safe range are shown in scientific notation and may lose exact precision.