Permutation and Combination CalculatorFree online math calculator — instant results, no sign-up

nPr and nCr.

Inputs

Permutations nPr
720
Combinations nCr120

Sign in to save results and favorites.

About the Permutation and Combination Calculator

This calculator computes the number of permutations (nPr) and combinations (nCr) when selecting a subset of items from a larger set. It is used in combinatorics, probability modeling, and data science to determine possible arrangements or groupings. The tool calculates both values simultaneously based on the total number of items and the number of items chosen.

n (total)
Total number of items in the set; a non-negative integer where n ≥ r (typically 0 to 170 in standard floating-point operations).
r (chosen)
Number of items to select from the set; a non-negative integer where 0 ≤ r ≤ n.

Formula and method

nPr = n! / (n - r)!
nCr = n! / (r! × (n - r)!)
  • nTotal number of items in the set
  • rNumber of items chosen from the set
  • !Factorial operator (product of all positive integers up to that number; 0! = 1)
  • nPrNumber of permutations (ordered arrangements)
  • nCrNumber of combinations (unordered selections)

The tool computes factorials for n, r, and the difference (n - r). Permutations are calculated as fact(n) / fact(n - r), and combinations are calculated as fact(n) / (fact(r) * fact(n - r)). Both results are rounded to whole numbers (0 decimal places).

Worked example

These are the calculator's starting values and the results it actually produces for them.

Inputs

  • n (total)10
  • r (chosen)3

Results

  • Permutations nPr720
  • Combinations nCr120

How to use the Permutation and Combination Calculator

  1. 1Enter the total number of distinct items available as n (total).
  2. 2Enter the number of items to select as r (chosen), ensuring r ≤ n.
  3. 3Calculate nPr by dividing n! by (n - r)! to find the total arrangements where order matters.
  4. 4Calculate nCr by dividing nPr by r! to find the total groups where order does not matter.

Reading your result

The 'Permutations nPr' output shows how many unique ordered sequences can be formed from the chosen items. The 'Combinations nCr' output indicates the number of unique groups that can be formed regardless of arrangement order. For any selection where r > 1, nPr will always be larger than nCr because each combination can be reordered in r! ways.

Limitations

The calculation assumes all n items are distinct and selections are made without replacement. It does not handle fractional, negative, or r > n inputs, and large values of n (typically above 170) will result in numerical overflow due to standard floating-point factorial limits.

Common questions

What is the key difference between permutations and combinations?+

Order matters in permutations, but not in combinations. For example, picking a 3-digit lock code (1-2-3 vs 3-2-1) is a permutation, whereas picking a 3-person committee from a group is a combination.

Why is 0 factorial equal to 1?+

By mathematical convention and definition, 0! = 1. This ensures that formulas like nPn = n! / (n - n)! = n! / 0! correctly evaluate to n!, and nC0 evaluates to 1.

Can r be greater than n?+

No. When sampling without replacement from a finite set of n distinct items, you cannot choose more items than the total set contains.

Does the calculator save my information?+

Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.

Further reading

You might also like

Results are estimates for informational purposes and are not financial, medical or legal advice.