Skip to content

Combinations and Permutations Calculator

Count how many ways you can select or arrange r items from a set of n.

What this answers

This calculator answers "how many distinct ways can I select or arrange r items from a set of n?" The answer depends critically on whether order matters. Choosing 2 people from a group of 5 to serve on a committee together is a combination (order does not matter); choosing 2 people from the same group to fill a president and a vice-president role separately is a permutation (order matters, since who gets which role changes the outcome).

How it is calculated

Combinations use the formula n! divided by (r! times (n minus r)!). Permutations use n! divided by (n minus r)!, always at least as large as the corresponding combination count since it credits every distinct ordering separately. This calculator computes both using log-gamma arithmetic internally rather than computing raw factorials directly, which lets it handle large values of n without numeric overflow, returning an exact integer when the result is small enough to represent exactly and a scientific-notation-scale value otherwise.

Worked example

For n=5 and r=2: the number of combinations (order does not matter) is exactly 10, while the number of permutations (order matters) is exactly 20, twice as many, since each of the 10 unordered pairs can be arranged in 2 different orders.

Assumption audit

Calculated from your data: the exact count for your chosen n, r, and ordering mode, and whether that count is representable as an exact integer or only as an approximate large value.
Evidence to review: whether you selected the correct mode (order matters or not) for your actual scenario, since this single choice can change the answer dramatically, as the worked example above shows.
You must verify: that your scenario genuinely involves selecting from a fixed set without replacement, and that the "order matters" question is answered correctly for what you are counting.

Common mistakes

Mixing up which formula applies to a given real-world question is the most frequent error: lottery number draws are typically combinations (the balls come out in some order, but only which numbers were drawn matters, not the order they appeared), while ranking the top three finishers in a race is a permutation (first, second, and third place are genuinely different outcomes). Asking directly whether swapping two selected items would count as a different outcome is a reliable way to decide which formula actually applies.

Limitations

This calculator assumes selection without replacement from a fixed set of n distinct items. Problems involving repeated selection with replacement, or selection from a set containing indistinguishable items, use different formulas not covered here.