How this calculator works
- Step 1Countn and rItems to choose from, and items chosen.
- Step 2Order?nPr or nCrRankings and codes count each order; groups do not.
- Step 3Repeats?nʳ or C(n+r−1, r)Whether one item can be picked twice.
Two questions decide the count: does the order of the picks matter, and can the same item be picked again?
The calculator works in exact whole-number arithmetic, so even counts with thousands of digits are right to the last digit.
Worked example: 3 from 10
- Permutations
nPr = n! ÷ (n − r)!- Combinations
nCr = nPr ÷ r!
- nItems to choose from 10
- rItems chosen 3
- In order10 × 9 × 8720
- Orders of each group3! = 3 × 2 × 16
- Groups720 ÷ 6120
Each group of 3 can be lined up in 6 orders, so there are six times as many permutations as combinations.
Familiar counts
- Five-card hands25,98,96052C5: order does not matter.
- 6-from-49 draw1,39,83,81649C6: one ticket covers one group.
- 4-digit PIN10,00010⁴: order matters, digits repeat.
Read the result
The answer counts outcomes. For a probability, divide the outcomes you want by this total.
All four variants are listed beneath the answer, so you can compare them without changing the settings.
Assumptions and limits
- Distinct itemsEach of the n items is different.
- r ≤ nWithout repeats, you cannot pick more than there are.
- ExactWhole-number arithmetic up to n = 1,000.
- Long countsOver 21 digits, shown as a power of ten with the digit count.
Related counting tools
Counting the ways something can happen is the first step to its probability.
To turn counts into chances, use the probability calculator or the binomial distribution calculator. For very large factorials, the big number calculator keeps every digit.
Common mistakes
Mistake: Using permutations for a team.
Instead: A team is the same whatever the order: use combinations.
Mistake: Forgetting repeats in a PIN.
Instead: Digits can repeat, so a 4-digit PIN has 10⁴ codes.
Mistake: Multiplying all n items.
Instead: Stop after r factors: 10 × 9 × 8 for 3 of 10.
Checking the method
Every golden case is re-worked from Pascal's triangle, built row by row.
An independent script builds Pascal’s triangle to row 220 and multiplies factorials directly, then compares all four counts.
Read how we test our calculators, or browse more maths calculators.