Free permutation and combination calculator
Calculate permutations P(n,r) and combinations C(n,r) — enter n and r to see how many ordered or unordered selections are possible, updated live, as you type.
On this page10 sections
C(n,r) = n! / (r! × (n−r)!). P(n,r) = n! / (n−r)!.
Results are estimates. Consult a professional.
How the permutation and combination calculator works
Permutations count the number of ways to arrange r items chosen from n items when order matters. Combinations count the number of ways to select r items from n when order does not matter. Both use the factorial function n! = n × (n−1) × … × 1.
Worked example: 5 people, 3 positions
Five candidates (A, B, C, D, E) are available. In scenario 1, you assign them to 3 ranked roles (1st, 2nd, 3rd). In scenario 2, you form a 3-person committee where roles are equal.
P(n,r) and C(n,r) values for n = 5 to 8
The table gives exact counts for common small values. Use these to double-check your inputs or quickly look up an answer.
| n | r | P(n,r) | C(n,r) |
|---|---|---|---|
| 5 | 2 | 20 | 10 |
| 5 | 3 | 60 | 10 |
| 6 | 2 | 30 | 15 |
| 6 | 3 | 120 | 20 |
| 7 | 2 | 42 | 21 |
| 7 | 3 | 210 | 35 |
| 8 | 2 | 56 | 28 |
| 8 | 3 | 336 | 56 |
Computed using P(n,r) = n!/(n−r)! and C(n,r) = n!/(r!(n−r)!)
Tips for permutations and combinations
The most common mistake is choosing the wrong formula. Ask yourself one question first: does the order of selection change the outcome?
- Ask "does order matter?" — ranking, scheduling, and passwords → permutations; teams, committees, and subsets → combinations.
- Repetition changes the formula — if items can be reused (e.g. a 4-digit PIN with repeated digits), use nʳ for permutations with repetition.
- C(n,r) = C(n, n−r) — choosing 3 from 10 gives the same number of groups as choosing 7 from 10; use the smaller r for easier calculation.
- Factorials grow very fast — 13! exceeds 6 billion; for large n use logarithms or Stirling's approximation to avoid overflow.
- Tree diagrams help small problems — for n ≤ 4 draw a tree to verify your formula answer before generalising.
Accuracy and limitations
Factorials produce exact integer results for small inputs but grow extremely rapidly: 21! exceeds the maximum safe integer in 64-bit double precision (2⁵³ ≈ 9 × 10¹⁵). This calculator uses arbitrary-precision integer arithmetic for n up to 170 (the largest n for which n! is finite in double precision). For n > 170, results switch to scientific notation and may lose the last few digits of precision. The formulas assume sampling without replacement; enable the repetition option for sampling with replacement.
Key terms
About this calculator
Part of our math calculators suite — explore all calculators.