There are 2,598,960 ways to choose 5 of 52 items when order doesn't matter. The exact count has 7 digits. If all outcomes are equally likely, the probability of any one is 3.848 × 10⁻⁷.
Comparison for n = 52, r = 5: bar length is log₁₀(count); zero counts are shown at 0.
How it's calculated S
Combinations
(rn)=r!(n−r)!n!=5!47!52!
Exact integer result
=2,598,960
Computed in exact BigInt arithmetic.
Chance of one particular outcome
2,598,9601=3.84769×10−7
Assumes every outcome is equally likely.
About the permutation and combination calculator
Combinations count the ways to pick r items from n when order doesn't matter: C(n, r) = n!/(r!(n − r)!). Permutations count each ordering separately, P(n, r) = n!/(n − r)!, so P(n, r) = C(n, r) × r!. When an item can be picked more than once, ordered picks number nʳ and unordered picks C(n + r − 1, r), the "stars and bars" count. Every answer is an exact whole number, up to 20,000 digits. In boundary cases N denotes the count: choosing zero items gives N = 1; an impossible selection gives N = 0.
The default, 5 cards from 52, gives 2,598,960 poker hands, so one particular hand has a 1 in 2,598,960 chance. The same arithmetic gives 13,983,816 tickets in a 6-of-49 lottery, 720 podium orders from 10 runners and 10,000 four-digit PINs.
The chance of one outcome assumes every outcome is equally likely. Answers of 22 digits or more are shown in scientific notation, with every digit listed up to 300 digits.
How to calculate combinations and permutations
A combination counts groups where order doesn't matter: nCr = n! ÷ (r!(n − r)!). A permutation counts ordered arrangements: nPr = n! ÷ (n − r)!. From 10 people there are C(10, 3) = 120 committees of three but P(10, 3) = 720 ways to award gold, silver and bronze.
Both formulas assume n different items, each used at most once. When items can repeat, as digits in a PIN do, use the repetition formulas further down.
What n! means
n! (n factorial) multiplies every whole number from n down to 1: 5! = 5 × 4 × 3 × 2 × 1 = 120, and 8! = 40,320. By definition 0! = 1, because there is exactly one way to arrange nothing.
A factorial is a permutation of all n items, so n! = P(n, n). Factorials grow fast: 143! has 248 digits, and 200! has 375 digits, about 7.89 × 10³⁷⁴.
That is far past the largest double-precision number, about 1.8 × 10³⁰⁸, so software that stores numbers as doubles overflows at 171!. Exact integer arithmetic avoids that limit.
How to calculate a combination by hand
Cancel before you multiply. In C(10, 3) = 10! ÷ (3! × 7!), the 7! cancels the tail of 10!, leaving (10 × 9 × 8) ÷ (3 × 2 × 1) = 720 ÷ 6 = 120.
Choosing r items is the same as choosing the n − r to leave out, so C(n, r) = C(n, n − r). C(52, 47) equals C(52, 5) = 2,598,960, and the smaller r is quicker to work.
n
r
Combinations nCr
Permutations nPr
5
2
10
20
10
3
120
720
52
5
2598960
311875200
49
6
13983816
10068347520
8
0
1
1
8
8
1
40320
The 52-and-5 row is the number of five-card poker hands, and 49 and 6 is a 6-from-49 lottery. The last two rows show 0! = 1 at work: there is one way to choose nothing and one way to choose everything.
How to calculate a permutation by hand
Multiply r numbers, counting down from n. A podium from 10 runners has 10 choices for gold, 9 for silver and 8 for bronze: 10 × 9 × 8 = 720.
The same three medalists can stand on the podium in 3! = 6 orders, which is why 720 is 6 × 120. In general nPr = nCr × r!.
Combination or permutation: which one?
Ask whether swapping two of the chosen items gives a different outcome.
Order doesn't matter, so use a combination: card hands, lottery tickets, committees, pizza toppings.
Order matters, so use a permutation: race finishes, rankings, seat assignments, passwords, officer roles.
Roles turn a group into an arrangement. Three of ten people as president, secretary and treasurer is P(10, 3) = 720, not 120. A "combination lock" is really a permutation lock, since 1-2-3 and 3-2-1 are different codes.
Counting with repetition
When an item can be chosen again, ordered picks number nʳ: each of the r positions has n options. A four-digit PIN has 10⁴ = 10,000 codes, from 0000 to 9999.
Unordered picks with repetition number C(n + r − 1, r), the "stars and bars" count. Three scoops from five flavors, repeats allowed, give C(7, 3) = 35 cups; chocolate, chocolate, vanilla counts once however the scoops are stacked.
n
r
Unordered with repetition
Ordered with repetition
5
3
35
125
10
4
715
10000
3
2
6
9
1
5
1
1
With only one kind of item, every pick is the same, so 1 and 5 gives a single outcome in both columns.
From a count to a probability
If every outcome is equally likely, the chance of one particular outcome is 1 ÷ count. A single 6-from-49 lottery ticket wins with probability 1 in 13,983,816.
For an event made of several outcomes, divide the favorable count by the total. Of the 2,598,960 possible hands, 4 are royal flushes, so the chance of being dealt one is 1 in 649,740.
Using permutations for an unordered draw. Counting ordered deals overstates five-card hands 120-fold: 311,875,200 against 2,598,960.
Treating identical items as different. The letters of BOOK form 4! ÷ 2! = 12 distinct arrangements, not 24, because swapping the two Os changes nothing. Divide by the factorial of each repeat count.
Ignoring rotations at a round table. Five people around a table can sit in (5 − 1)! = 24 distinct ways, since moving everyone one seat along gives the same arrangement.
Choosing more items than exist. Without repetition, r > n gives 0 ways: C(3, 5) and P(3, 5) are both 0. With repetition it becomes possible: C(3 + 5 − 1, 5) = 21 unordered and 3⁵ = 243 ordered.
Large and exact answers
n and r are whole numbers up to 10,000,000, and every count is exact up to about 20,000 digits.
For n!, count permutations with r equal to n.
Answers of 22 to 300 digits are also listed digit by digit. 143! qualifies; 200! is shown in scientific notation with its digit count.
OpenStax's counting principles chapter works through the multiplication principle, permutations and combinations with more examples.
Worked examples
5-card hands from 52 (defaults)
Count
Combinations: order doesn't matter
Items to choose from (n)
52
Items chosen (r)
5
Number of ways
2,598,960
Digits in the answer
7
Chance of one particular outcome
3.848 × 10⁻⁷
Checked against: C(52,5) = 2,598,960
Podium from 10 runners
Count
Permutations: order matters
Items to choose from (n)
10
Items chosen (r)
3
Number of ways
720
Checked against: 10 × 9 × 8 = 720
6 of 49 lottery
Count
Combinations: order doesn't matter
Items to choose from (n)
49
Items chosen (r)
6
Number of ways
13,983,816
Chance of one particular outcome
7.151 × 10⁻⁸
Checked against: 1/13983816 = 7.15112e-8
C(100, 50) exactly
Count
Combinations: order doesn't matter
Items to choose from (n)
100
Items chosen (r)
50
Number of ways
1.00891 × 10²⁹
Digits in the answer
30
Checked against: Independent calculation
Questions
What is the difference between a permutation and a combination?
A permutation counts orderings; a combination counts only which items are chosen. From 10 runners there are P(10, 3) = 720 ways to fill gold, silver and bronze, but only C(10, 3) = 120 different groups of three, because each group can be ordered in 3! = 6 ways. Use permutations for rankings, seatings and passwords, and combinations for hands, committees and lottery tickets.
How many 5-card poker hands are there?
There are C(52, 5) = 2,598,960 five-card hands from a standard 52-card deck, counting each set of cards once regardless of the order dealt. Only 4 of them are royal flushes, so the chance of being dealt one is 4 in 2,598,960, or 1 in 649,740. Counting ordered deals instead gives P(52, 5) = 311,875,200.
How are lottery jackpot odds calculated?
Multiply the number of combinations for each drawn set. A 6-from-49 draw has C(49, 6) = 13,983,816 possible tickets. Powerball draws 5 of 69 white balls and 1 of 26 red balls, so the jackpot odds are C(69, 5) × 26 = 11,238,513 × 26, or 1 in 292,201,338. Order doesn't matter in these games, which is why combinations apply.
How many 4-digit PIN combinations are there?
There are 10⁴ = 10,000 four-digit PINs, from 0000 to 9999, because each of the 4 positions can hold any of 10 digits. Strictly this is a permutation with repetition, since 1234 and 4321 are different codes; a "combination lock" is really a permutation lock. A 6-digit PIN has 10⁶ = 1,000,000 possibilities.
Why is 0! equal to 1?
0! = 1 by definition, because there is exactly one way to arrange zero items: the empty arrangement. The convention keeps the formulas consistent, so C(n, 0) = n!/(0! × n!) = 1 and C(n, n) = 1. It also matches the gamma function, where 0! = Γ(1) = 1, and the recursion n! = n × (n − 1)! at n = 1.
This calculator includes 9 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.
Put this calculator on your site
Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.