How to use the permutation and combination calculator
- Enter Total items n, the number of things you can choose from.
- Enter Chosen r, how many you pick.
- Read Permutations nPr if order matters and Combinations nCr if it does not.
- If items can be reused, read Permutations with repetition (nʳ) or Combinations with repetition C(n + r − 1, r).
- The Formulas box shows the rules the tool uses.
What it does and when to use it
Counting problems are a big part of probability, statistics and exam maths. “How many ways can 3 books be arranged from 10?” or “How many poker hands are there?” are answered with nPr and nCr. Probability questions then divide favourable outcomes by these totals.
Both formulas are built from factorials. To see a factorial itself, such as 10! = 3,628,800, use the factorial calculator. For the elements of small sets and their overlaps, try the set theory calculator, and to turn a count into a percentage chance, the percentage calculator helps.
How it works
| Count | Formula | Order matters? | Repeats? |
|---|---|---|---|
| nPr | n! ÷ (n − r)! | yes | no |
| nCr | n! ÷ (r! (n − r)!) | no | no |
| nʳ | n × n × … (r times) | yes | yes |
| C(n + r − 1, r) | (n + r − 1)! ÷ (r! (n − 1)!) | no | yes |
The tool never builds the full factorials. nPr is the product n × (n − 1) × … with r factors. nCr is built one factor at a time, multiplying and dividing so every step stays a whole number, and it uses the smaller of r and n − r. All arithmetic is exact, with no size limit on the digits.
Step by step for n = 10, r = 3:
- Permutations: start at 10 and multiply 3 numbers going down. 10 × 9 × 8 = 720.
- Each group of 3 can be ordered in 3! = 3 × 2 × 1 = 6 ways.
- Combinations: 720 ÷ 6 = 120.
- With repetition: 10³ = 1,000 ordered choices, and C(12, 3) = 220 unordered ones.
The tool shows Permutations nPr: 720 and Combinations nCr: 120.
Worked examples
Choosing 3 from 10. nPr = 720, Combinations nCr: 120.
Poker hands. n = 52 cards, r = 5: Combinations nCr: 2,598,960. If the order of dealing mattered, nPr would be 311,875,200.
Small case to check by hand. n = 4, r = 2: nPr = 12, nCr = 6, nʳ = 16 and Combinations with repetition C(n + r − 1, r): 10. You can list all 10 pairs, such as AA, AB, AC, AD, BB and so on.
r larger than n. n = 3, r = 5: the tool reports 0 — you cannot choose more items than there are, but nʳ = 243 and C(7, 5) = 21.
Limits and tips
- n and r must be whole numbers, 0 or more.
- nʳ is reported as “too large” when it would have more than about 100,000 digits.
- All counting runs in your browser.
Frequently asked questions
How do I know whether to use a permutation or a combination?
What does "with repetition" mean?
Why do I get 0 when r is bigger than n?
How big can n and r be?
Are 0P0 and 0C0 allowed?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.