Skip to content

Factorial, Permutation and Combination Calculator

Calculate n factorial, permutations P(n, r) and combinations C(n, r) exactly (no rounding) for n and r up to 21; a flag shows when r is greater than n.

Version 1

Things to keep in mind:

  • Only selection without repetition is computed; when items may repeat (e.g. n^r) the results differ.
  • n and r are limited to 21; larger values are not supported.
  • Circular permutations, permutations with identical items and multi-group selections need different formulas.

Calculator

Values of n and r

Whole number from 0 to 21: the total number of objects to choose from.

Whole number from 0 to 21. If r is greater than n, permutations and combinations show 0.

After the first calculation, the result updates automatically when you change a value.

Result

Enter the values and press Calculate to see the result here.

About this tool

This tool computes the three basic counting values as exact integers: factorial, permutation and combination (n and r up to 21).

Formulas

  • Factorial: n! = 1 × 2 × 3 × … × n, with 0! = 1
  • Permutation (order matters): P(n, r) = n! / (n − r)!
  • Combination (order does not matter): C(n, r) = n! / (r! × (n − r)!)

Permutations and combinations count the ways to pick r items from n without repetition. Ranking the top three in a race is a permutation; choosing three people for a committee is a combination. Each combination corresponds to r! orderings, so C(n, r) = P(n, r) / r!.

Example: for n = 5 and r = 3, 5! = 120, P(5, 3) = 5 × 4 × 3 = 60 and C(5, 3) = 60 / 6 = 10. If r is greater than n (for example n = 10, r = 12) no selection is possible: P and C show 0 and "valid selection" is 0.

Since 21! is about 5.11 × 10²⁰, results are shown as exact integers without rounding. Larger n would need logarithmic or approximate methods.

How to use

  1. Enter the total number of items as n (0-21).
  2. Enter the number of items to choose as r (0-21).
  3. Click Calculate to see n!, r!, P(n, r) and C(n, r).

Notes

All results are exact integers with no rounding. n and r can be at most 21; 21! = 51,090,942,171,709,440,000. When r > n, permutations and combinations show 0. Permutations or combinations with repetition and circular arrangements are not computed.

Frequently asked questions

5 questions
  1. In a permutation the order of the chosen items matters (ABC differs from CBA); in a combination it does not. Hence C(n, r) = P(n, r) / r! is always less than or equal to P(n, r).

Next step

Related tools to continue your calculation.

All tools in Math & Geometry