TTKTheTextKit

Permutation and Combination Calculator

Enter the number of items n and the number you choose r to get the number of combinations (order does not matter) and permutations (order matters), both without and with repeats, together with n factorial and r factorial. The results are exact whole numbers, even for huge values such as 52 choose 26. Everything is worked out in your browser.

Combinations nCr
2,598,960
Order does not matter, no repeats
Permutations nPr
311,875,200
Order matters, no repeats
Permutations with repeats
380,204,032
n to the power of r, order matters
Combinations with repeats
3,819,816
C(n + r - 1, r), order does not matter
n factorial
8.06582e+67
n! = 1 x 2 x ... x n. 68 digits. Tick Show every digit to see them all
r factorial
120
r! = 1 x 2 x ... x r

A permutation counts arrangements where order matters, so choosing A then B differs from B then A. A combination counts selections where order does not matter. Both n and r can be up to 1000, and the results are exact whole numbers, not rounded estimates. With repeats means an item can be chosen more than once, such as the digits of a PIN. Everything is worked out in your browser and nothing is uploaded.

Related Tools

[5 suggestions]

About the Permutation and Combination Calculator

A permutation is an ordered arrangement, so choosing A then B differs from choosing B then A, and the count of r items from n is n! divided by (n - r)!. A combination ignores order and divides that count by r! as well, giving n! divided by (r! times (n - r)!). With repeats, an item may be chosen more than once: ordered choices number n to the power of r, such as the 10,000 possible 4-digit PINs, and unordered choices number C(n + r - 1, r). A factorial n! is the product of the whole numbers from 1 to n, and 0! is defined as 1. The calculator uses exact big-integer arithmetic, so results are never rounded: 52 choose 5 is 2,598,960 and 49 choose 6 is 13,983,816. Values with more than 15 digits are shown in scientific form unless you tick Show every digit, and copying a result copies what is shown. Both n and r can be up to 1,000. If r is larger than n, the counts without repeats are 0 because you cannot pick more distinct items than exist, and the tool says so. The results were checked against the factorial formula and Pascal's rule for every n up to 30. Nothing is uploaded.

What is the difference between a permutation and a combination?▾

In a permutation the order matters, so ABC and CBA are different. In a combination the order does not matter, so they are the same selection. Picking a podium of 3 from 10 runners is a permutation (720). Picking a committee of 3 from 10 people is a combination (120).

What is the formula for nPr and nCr?▾

nPr = n! / (n - r)! and nCr = n! / (r! (n - r)!). So nCr = nPr / r!. For n = 5 and r = 3, nPr is 60 and nCr is 10.

When should I allow repeats?▾

Allow repeats when the same item can be chosen again, like digits in a PIN or flavors on a cone with several scoops. Ordered with repeats is n to the power of r. Unordered with repeats is C(n + r - 1, r). Without repeats, each item can be used once.

Why is 0! equal to 1?▾

It keeps the formulas working: there is exactly one way to arrange zero items, which is to do nothing, and it makes nCr equal 1 when r is 0 or n. It is also what the product of no numbers gives.

How many 5-card poker hands are there?▾

There are 2,598,960 different 5-card hands from a 52-card deck, which is 52 choose 5. Order does not matter in a hand, so it is a combination. Use the 5 cards from 52 button to see it.