Calculate combination

Count ordered and unordered selections, with and without replacement.

freeworks offlinenothing uploaded
ToolCombination Calculator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Factorial products compute permutations and combinations, with separate formulas for repeated selection. Symmetry reduces n choose r to only min(r, n−r) product steps before division.

  • All four counts appear because order and replacement describe the sampling process.
  • Inputs must be whole numbers with 0 ≤ r ≤ n.

Worked example

Choosing 2 from 5
All four variants for n = 5, r = 2
Input
											N: 5
R: 2
										
Output
												Permutations without repetition: 20
Combinations without repetition: 10
Permutations with repetition: 25
Combinations with repetition: 15
											

When to use this

Committee counts use unordered selection, PIN exercises use ordered choices with repetition, and card-hand calculations use combinations without replacement.

Edge cases

  • Choosing five items from three without replacement is rejected because r exceeds n.
  • Repeated source items require multiset counting; these formulas assume n distinct item types.
  • Counts beyond JavaScript’s safe-integer range are rejected instead of printing a rounded integer as exact.