How to use the combinations and permutations calculator
- Enter n, the number of items to choose from, and r, the number you choose. Both are whole numbers from 0 to 1,000.
- Choose whether items can be repeated or not.
- Read the number of combinations (order does not matter) and permutations (order matters), with the factorials and steps.
Formula
nPr = n! / (n - r)! and nCr = n! / (r! x (n - r)!)
With repetition: ordered n^r, unordered C(n + r - 1, r)
n! = n x (n - 1) x ... x 2 x 1, with 0! = 1
All values are exact integers computed with big-integer arithmetic. No rounding is used at any step.
Worked examples
10 choose 3. Permutations: 10 x 9 x 8 = 720. Combinations divide by the 3! = 6 orderings of the same group: 720 / 6 = 120.
20 choose 10 = 184,756, and 52 choose 5 = 2,598,960, the number of five-card poker hands.
With repetition, 5 flavors and 3 scoops: ordered 5³ = 125, and unordered C(5 + 3 - 1, 3) = C(7, 3) = 35.
1000 choose 500 has 300 digits and starts 2.7028824, so it is shown as 2.7028824e+299. The CSV holds all 300 digits.
Order and repetition
Ask two questions about your problem. Does order matter? Picking a president, a vice president and a treasurer from 10 people is a permutation, since the roles differ, and picking a 3-person committee is a combination. Can an item be used again? A lock code can repeat digits, so it is counted with repetition, while dealing cards does not.
Large results
Counts grow very fast. 52! has 68 digits and 1000! has 2,568. The tool shows up to 30 digits exactly with thousands separators, and uses scientific notation with the digit count beyond that. Stats show the exact value up to 120 digits, and the CSV download always holds the complete integer. n is limited to 1,000 to keep results instant.
Edge cases handled
There is exactly one way to choose nothing and one way to choose everything, so r = 0 and r = n both give 1. Without repetition, r cannot exceed n, and the tool tells you to switch to repetition if that is what you meant. With no items and at least one pick there are 0 outcomes. For related number work see the GCF and LCM calculator, and for spread in a set of results use the standard deviation calculator.
Assumptions and limits
- n and r must be whole numbers from 0 to 1,000.
- Without repetition each item is distinct and can be chosen once.
- With repetition, r can be larger than n.
- Probabilities are not computed. Divide a count of favorable outcomes by the total count yourself.
- Everything runs in your browser using exact integers.
Frequently asked questions
What is the difference between a combination and a permutation?
A permutation counts arrangements where order matters, so ABC and CBA are different. A combination counts groups where order does not matter, so they are the same group.
Why is 0! equal to 1?
There is exactly one way to arrange zero items, which is to do nothing. It also keeps formulas such as n choose n equal to 1 consistent.
How many five-card poker hands are there?
There are 52 choose 5, which is 2,598,960 hands, since the order in which you receive the cards does not matter.
What does combinations with repetition mean?
You can pick the same item more than once and order still does not matter, like choosing 3 scoops from 5 flavors. The count is C(n + r - 1, r).
Why is n limited to 1,000?
Beyond that the integers have thousands of digits and are slow to display or copy. The cap keeps the tool responsive and still covers nearly every practical problem.