Permutation and Combination Calculator

Find nPr and nCr, the ways to arrange or choose r items from n, with and without repeats, as exact whole numbers.

Enter n and r

Whole numbers from 0 to 5,000. Results update as you type.

Try an example

How to use the permutation and combination calculator

  1. Type the total number of items into n (total items) and how many you pick into r (items chosen). The page opens with n = 10 and r = 3.
  2. Read the two large boxes: Combinations C(n, r) when the order of the picks does not matter, and Permutations P(n, r) when it does.
  3. Below them, Permutations with repetition and Combinations with repetition give the answers when an item can be picked more than once.
  4. Tap an example under Try an example (Poker hand, Lottery 6/49, 4-digit PIN), or use Copy results to copy all four numbers.

The formulas

These are the standard definitions for a permutation, a combination and the binomial coefficient. The calculator multiplies exact whole numbers one step at a time instead of dividing giant factorials, so results stay exact even with thousands of digits.

Worked example with the default values

With n = 10 and r = 3 the tool shows:

  • P(10, 3) = 10 ร— 9 ร— 8 = 720
  • C(10, 3) = 720 รท (3 ร— 2 ร— 1) = 120
  • Permutations with repetition: 10^3 = 1,000
  • Combinations with repetition: C(12, 3) = 220

Each group of 3 can be lined up in 3! = 6 orders, so 720 arrangements collapse into 720 รท 6 = 120 groups.

Real uses

Limits and edge cases

To turn counts into odds, use the probability calculator. To work with n! directly, use the factorial calculator.

Frequently asked questions

What is the difference between a permutation and a combination?

Order. A permutation counts different orders as different results, like president, vice president and treasurer. A combination does not, like a three-person committee. That is why P(n, r) is always r! times C(n, r).

How many 5-card poker hands are there?

There are 2,598,960 hands, which is C(52, 5). Choose Poker hand under Try an example to see it.

What are the odds of winning a 6/49 lottery?

The odds are 1 in 13,983,816, because there are C(49, 6) = 13,983,816 equally likely combinations of six numbers.

How many 4-digit PIN codes are there?

There are 10,000. Digits can repeat and order matters, so it is a permutation with repetition: 10^4 = 10,000.

Why is C(n, 0) equal to 1?

There is exactly one way to choose nothing: pick no items. In the formula, 0! = 1, so C(n, 0) = n! / (0! ร— n!) = 1.

Sources: Wolfram MathWorld, Permutation; Wolfram MathWorld, Combination; NIST Digital Library of Mathematical Functions, section 26.3 (binomial coefficients).