←

Permutations and Combinations Calculator

nPr, nCr and factorials, with exact big numbers
Try
Combinations (order doesn’t matter)2,598,960n! / (r! (n − r)!)≈ 2.5989e+6
Permutations (order matters)311,875,200n! / (n − r)!≈ 3.1187e+8
n factorial806581751709…000000 (68 digits)n!≈ 8.0658e+67
r factorial120r!
More info

Combinations or permutations?

Both count the ways to pick r things from a set of n. In a combination the order does not matter: choosing the cards A, K, Q is the same hand as Q, K, A. In a permutation the order matters: a race where Anna wins and Ben is second is different from one where Ben wins. A quick test is to ask whether swapping two chosen things gives a different result. If it does, use permutations (nPr); if not, use combinations (nCr). Tick Allow repeats when the same thing can be picked more than once, as with the digits of a PIN code (n = 10, r = 4, order matters, so 10 to the power 4 = 10,000).

The formulas

Without repeats, the number of permutations is n! / (n − r)! and the number of combinations is n! / (r! (n − r)!), where n! (“n factorial”) is 1 × 2 × 3 × … × n and 0! is 1. With repeats allowed, permutations are n to the power r, and combinations are the number of ways to choose r from n kinds with repeats, which is C(n + r − 1, r). The tool uses exact integer arithmetic, so even 100 choose 50 (about 1 × 10 to the power 29) is exact, and very long results are shown with their first and last digits and the number of digits.

Questions

How many five-card poker hands are there? 52 choose 5, which is 2,598,960. What are the odds of a 6-from-49 lottery jackpot? One in 13,983,816. What is the largest number I can enter? n and r up to 2000. Is this the same as probability? Counting ways is the first step; divide the favorable count by the total count to get a probability. For fractions of the result, use the Fraction Calculator.