๐Ÿ”ข Combination & Permutation Calculator

Enter n between 0 and 1000, with r โ‰ค n
Permutations (nPr)720
Combinations (nCr)120

Calculate the total number of permutations (nPr) and combinations (nCr) when choosing r items out of n. Permutations count order as significant, while combinations don't. Useful for probability and statistics homework, or for figuring out how many possible outcomes a lottery or drawing has.

How to use

  1. Enter the total number of items, n.
  2. Enter how many items to choose, r (r โ‰ค n).
  3. The permutation (nPr) and combination (nCr) values are calculated automatically.

How the calculation works

This tool counts permutations and combinations when choosing r items from n. Permutations (nPr): the order of the chosen items matters nPr = n ร— (n โˆ’ 1) ร— โ€ฆ ร— (n โˆ’ r + 1) = n! รท (n โˆ’ r)! Combinations (nCr): only which items are chosen matters nCr = nPr รท r! = n! รท (r!(n โˆ’ r)!) Combinations use the smaller of r and n โˆ’ r, since nCr = nC(nโˆ’r). Results grow enormous (1000C500 has 300 digits), so the tool calculates with JavaScript BigInt, which has no digit limit, and shows every digit exactly. n can be up to 1000.

Worked example

Choosing 3 people from 10 Order matters (chair, vice-chair, secretary): 10P3 = 10 ร— 9 ร— 8 = 720 Order does not matter (a committee of 3): 10C3 = 720 รท 3! = 120 Japan's Loto 6 (6 numbers from 1โ€“43): 43C6 = 6,096,454 A 5-card hand from 52 cards: 52C5 = 2,598,960

Things to be aware of

  • When r = 0 there is exactly one way (choose nothing): nP0 = nC0 = 1.
  • If items can be chosen repeatedly (combinations with repetition), use (n+rโˆ’1)Cr instead.
  • For probabilities, divide the favourable count by the total count (Loto 6 first prize is 1 in 6,096,454).

FAQ

What's the difference between a permutation and a combination?

A permutation (nPr) counts different orderings of the chosen items as distinct. A combination (nCr) only counts the set of chosen items, ignoring order.

Is there a limit on n?

n is capped at 1000 to avoid calculation and display issues.

What happens if r is greater than n?

You can't choose more items than are available, so no result is shown. Make sure r โ‰ค n.