Permutation & Combination Calculator (nPr, nCr, Factorial)
Enter n and r to get the factorial n!, permutations nPr, combinations nCr, permutations with repetition n^r and combinations with repetition nHr at once. Everything is computed with BigInt, so large results are shown in full with no rounding error. For gacha odds, see the Gacha Probability Calculator; for means and variance, use the Statistics Calculator.
🔒 Runs in your browser · Your data is never sent to a server
Results
Factorial n!n!
Ways to arrange all n items in a row
Permutations nPrnPr
Choose r of n items where order matters, no repeats
Combinations nCrnCr
Choose r of n items where order does not matter
Permutations with repetition n^rn^r
Fill r positions from n kinds, repeats allowed
Combinations with repetition nHrnHr
Choose r items from n kinds, repeats allowed, order ignored
Odds of hitting one outcome
- One specific ordered arrangement (1 / nPr)
- One specific combination (1 / nCr)
Notes
- n and r accept whole numbers from 0 to 10000. Larger values are rejected because computing and showing every digit would take too long.
- nPr and nCr are only defined when r ≤ n. When r is greater than n, only n^r and nHr (with repetition) are shown.
- The tool uses 0! = 1, nP0 = nC0 = 1 and 0^0 = 1. For n = 0, 0Hr is 1 when r = 0 and 0 when r is 1 or more.
- Full values can run to tens of thousands of digits; the Copy button copies every digit. Scientific notation is truncated to six significant digits.
- The odds assume every arrangement or combination is equally likely. They do not apply to weighted draws.
Glossary
Permutation (nPr) vs. combination (nCr)
A permutation counts selections where order matters; a combination counts them where order does not. They are related by nCr = nPr ÷ r!. Choosing 2 people out of 5 gives 20 ordered ways but only 10 unordered ones.
Repetition (n^r and nHr)
These count selections where the same item may be picked more than once. With repetition, ordered sequences number n^r and unordered selections number nHr = (n+r−1)Cr. Rolling a die three times gives 6^3 = 216 sequences but 6H3 = 56 unordered outcomes.
Factorial (n!)
The product of every whole number from 1 to n. It is the number of ways to line up n items. It grows very fast: 20! is already about 2.4×10^18.
FAQ
When should I use permutations instead of combinations?
Use permutations (nPr) when order matters and combinations (nCr) when it does not. Awarding 1st, 2nd and 3rd place is a permutation; picking a 3-person committee is a combination. They are linked by nCr = nPr ÷ r!.
Why are nPr and nCr missing when r is greater than n?
Without repetition you cannot choose more items than you have, so nPr and nCr are undefined (zero ways). Permutations n^r and combinations nHr with repetition still make sense when r exceeds n, so those are shown.
Are large factorials and combinations exact?
Yes. The tool uses BigInt arbitrary-precision integers, so values such as 100! or 10000! are computed with no rounding error, unlike a calculator or spreadsheet that falls back to approximations like 1.2e+30.
Is there a limit on n and r?
Both must be whole numbers from 0 to 10000. 10000! has about 35,660 digits and 10000^10000 has 40,001, so larger inputs are rejected to keep the page responsive.
What are 0! and 0^0 here?
Following the usual combinatorics convention, 0! = 1 and 0^0 = 1. nP0 and nC0 are both 1: there is exactly one way to choose nothing.
Share this page
