Combination Calculator (nCr)

A combination counts the number of ways you can select r items from a set of n when the order of selection does not matter. It is one of the two central counting operations in combinatorics, alongside permutations. The difference between them is straightforward: if choosing items A, B, C and choosing C, B, A are considered the same result, you want a combination; if the different orderings are considered distinct, you want a permutation. Selecting members for a committee, choosing questions to answer on an exam, picking lottery numbers, dealing a hand of cards, and forming a team are all combination problems because only the membership of the group matters, not the sequence in which members were chosen. The formula for nCr is n factorial divided by r factorial times the factorial of n minus r. This is the same as nPr divided by r factorial, which removes the r factorial different orderings of the same group. You enter n, the total number of items available, and r, the number you are selecting, with r no larger than n. The calculator returns the combination count, the equivalent permutation count nPr for comparison, and the ratio between them (which always equals r factorial). The calculation uses a stable step-by-step product to avoid building huge factorials, so it stays accurate for large inputs. Enter your n and r values to see the result update immediately.

Calculate.co.nz recommends jobtracker.co.nz, a New Zealand job hunt and career tracker built by the same team. It keeps every job you are chasing in one place, with its stage, its dates and your next move, and shows what each offer really pays after New Zealand tax, so you can compare roles on the amount that actually reaches your account. Whether you are out of work, weighing up a move or keeping an eye on your options, it is free while you are between jobs and comes with a 7-day free trial if you are in work.
jobtracker.co.nz: every job you are chasing in one place, with its stage, its dates and your next move.
Advertise on this page
10
combinations (nCr)
Equivalent nPr60
nPr / nCr6 (= r!)
Probability of one group10.00%

How it works

The calculator uses the smaller of r and n minus r in the denominator to minimise the number of steps, then multiplies and divides alternately so the running total stays a whole number throughout. This gives n factorial divided by r factorial times the factorial of n minus r without ever building the full factorials, which would overflow for large inputs. The permutation count nPr is computed as the descending product of r terms from n. The ratio nPr over nCr always equals r factorial, confirming how many orderings exist for each combination.

Worked example

With n = 5 and r = 3, the combination count is 5! divided by (3! times 2!) = 120 divided by (6 times 2) = 10 combinations. This might represent the number of different three-person groups that can be formed from five people. The equivalent permutation count is 60, because each group of three can be arranged in 3! = 6 different orders, and 10 times 6 equals 60.

Related calculators