Skip to content

Math

Permutation and Combination

Enter your values and the result updates as you type. The formula and a worked example are below the calculator.

How many different items you choose from.

Whole numbers from 0 up to n.

Try an example

Permutations, nPr (order matters)

30

6!(6 - 2)!

Short form: 6 × 5

Combinations, nCr (order does not matter)

15

6!2! × (6 - 2)!

If items may be picked again (with replacement)

Ordered, 6^2
36
Unordered, C(6 + 2 − 1, 2)
21

Permutations count lineups where the order of the picks matters (1-2-3 is not 3-2-1). Combinations count groups where it does not.

How to use

  1. Enter n, the number of different items you can choose from.
  2. Enter r, how many items you pick each time. It can be anything from 0 up to n.
  3. Read nPr when the order of the picks matters (a lineup, a PIN, a batting order) and nCr when only the chosen group matters (a committee, a hand of cards).
  4. Open the formula lines to see the factorials written out, and the last block for the case where an item may be picked again.

Formula

Permutations nPr = n! / (n - r)!. Combinations nCr = n! / (r! x (n - r)!), so nCr = nPr / r!. If items may repeat: ordered picks = n^r, unordered picks = (n + r - 1)! / (r! x (n - 1)!).

Example

From a cricket squad of 15, picking a captain and a vice-captain in that order gives 15P2 = 210 ways. Picking any 2 players for a committee gives 15C2 = 105, exactly half as many, because the order of the two names no longer counts.

n and r must be whole numbers up to 999,999. Very long answers are shown as a ten-digit approximation with their number of digits, so the page stays quick. Items are treated as all different from each other.