Combination Calculator (nCr)
Calculate combinations C(n,r) and permutations P(n,r) — how many ways to choose r items from n, with or without regard to order.
About the Combination Calculator (nCr)
A combination is a selection of items from a larger set where the order of selection does not matter. The notation C(n,r) — also written nCr or 'n choose r' — represents the number of ways to choose r items from n distinct items without repetition and without regard to order. For example, if you are choosing 3 toppings from a menu of 10, the order you pick them is irrelevant, so you use combinations. The formula is n! / (r! × (n−r)!), where ! denotes factorial — the product of all positive integers up to that number.
A permutation, by contrast, counts arrangements where order matters. P(n,r) = n! / (n−r)! answers questions like: 'In how many ways can I arrange 3 items chosen from 10?' If first, second, and third place exist, order matters, and permutations apply. The number of permutations is always equal to or greater than the number of combinations for the same n and r, because each combination can be arranged in r! different orders: C(n,r) × r! = P(n,r).
Combinations and permutations appear throughout probability theory, statistics, cryptography, genetics, and everyday life. They are the foundation for calculating lottery odds, password strength, poker hand probabilities, and experimental design. Our calculator handles both instantly, displays the formulas with your values substituted in, and correctly handles edge cases like r = 0 (result is always 1) and r = n (result is always 1 for combinations).
Pros & Cons
- +Calculates both combinations and permutations simultaneously
- +Shows the formula with your values substituted in
- +Uses BigInt arithmetic — handles large factorials without overflow (up to n = 170)
- +Instantly displays results without page reload
- +Free with no sign-up required
- −Limited to n ≤ 170 due to JavaScript's numeric precision limits
- −Does not handle combinations with repetition (multiset coefficients)
- −Does not calculate partial permutations with repetition allowed
- −Results for very large n and r can be extremely large numbers
- −Does not solve inverse problems (given the combination count, find n or r)
When to Use Combinations vs. Permutations
The key question is always: does order matter? If you are picking lottery numbers, a committee, or pizza toppings, order does not matter — use combinations. If you are arranging books on a shelf, assigning finishing positions in a race, or forming a PIN code, order matters — use permutations. A helpful mnemonic: Combinations are for Committees (order irrelevant), Permutations are for Placements (sequence matters).
In probability, combinations let you calculate odds precisely. For a standard lottery where you pick 6 numbers from 1 to 49, the total number of possible tickets is C(49,6) = 13,983,816. The probability of winning the jackpot with one ticket is 1 / 13,983,816 ≈ 0.0000000715 or about 1 in 14 million. Permutations answer questions like: how many ways can 8 runners finish in 1st, 2nd, and 3rd place? P(8,3) = 8!/(8-3)! = 336.
When repetition is allowed (for example, a combination lock where the same digit can appear multiple times), neither nCr nor nPr applies directly. A combination lock with 4 digits from 0–9 with repetition has 10^4 = 10,000 possible combinations. For selections with repetition where order doesn't matter, the formula is C(n+r-1, r), sometimes called the stars and bars formula.