calc-hub logocalc-hub.net

Permutation and Combination Calculator

Enter n, the number of items, and r, how many you pick. Both are whole numbers and r can be no larger than n. The calculator shows the permutations nPr, where order matters, and the combinations nCr, where it does not, as exact whole numbers with every digit.

How to use the Permutation and Combination Calculator

  1. Enter your numbers in the Permutation and Combination Calculator above.
  2. Press the Calculate button to see the result.
  3. To try other numbers, change any value and press the button again.

The permutation and combination formulas

Permutations: nPr = n! / (n−r)! · · · Combinations: nCr = n! / (r!(n−r)!)

Permutations count arrangements (order matters). Combinations count subsets (order doesn't). nCr is always nPr divided by r! (the number of orderings of r items). The calculator multiplies whole numbers without rounding. r goes up to 20,000, and the number of digits in n times r, with an r of 0 counted as 1, can be at most 250,000.

Worked example

How many ways to arrange 3 books from a shelf of 7? P(7,3) = 7!/(4!) = 210. How many ways to choose 3 books to take on vacation? C(7,3) = 7!/(3!4!) = 35.

Frequently asked questions

When do I use permutation vs. combination?

Permutation: order matters (election results, race finishes, passwords). Combination: order doesn't matter (lottery picks, sub-committees, hand of cards).

How does this relate to factorials?

Factorial n! = n × (n−1) × ... × 2 × 1 counts all orderings of n items. Permutation and combination formulas are factorial ratios that count specific subsets of those orderings.

How large can n and r be?

r can be up to 20,000 and no larger than n. n can have up to 250,000 digits, and r times the number of digits in n must be 250,000 or less, so a 20-digit n allows r up to 12,500. Results print in full, so C(1000, 500) shows all 300 of its digits. Larger inputs, decimals and negative numbers get a message instead of a result.

Why does C(n, r) = C(n, n−r)?

Choosing r items is equivalent to choosing the n−r to leave out. C(10, 3) = C(10, 7) = 120.

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.