b2KIT

Permutation & Combination Calculator

Calculate permutations and combinations (nPr, nCr) with step-by-step factorial breakdown.

Tested tool guide Tested browser tools Checked August 16, 2026

What Permutation & Combination Calculator does, with a checked example

Given a set size n and a selection size r, this calculator returns the two counting numbers built on factorials: nPr, the ordered ways to choose r items, and nCr, the ways when order does not matter. The factorial expansion is written out for each, so the arithmetic can be checked line by line. The mistake most people make is computing the wrong one of the two: whether order matters is the entire difference, and nPr is always nCr times r!. Scale is the other surprise - 8P3 is 336, while 20P10 is past 670 billion, so a result that looks too large is often exactly right.

Worked example

A concrete input and expected output from the current implementation.

Input

n = 8, r = 3

Expected output

nPr (permutations): 8P3 = 8! / (8 - 3)! = 40320 / 120 = 336
nCr (combinations): 8C3 = 8! / (3! x (8 - 3)!) = 40320 / (6 x 120) = 40320 / 720 = 56

Ordered picks fill 3 slots with 8, then 7, then 6 choices, giving 8 x 7 x 6 = 336. Combinations count the 3! = 6 orderings of the chosen trio as one result, so 336 / 6 = 56. The pair always differs by exactly r!.

How the result is produced

1

The two formulas

Both answers come from one pattern. nPr = n! / (n - r)! counts ordered arrangements: fill r slots one at a time, with one fewer choice per slot, which equals n! divided by the leftover (n - r)!. nCr = n! / (r! x (n - r)!) takes that same quotient and divides by r! again, stripping out the r! internal orderings of the chosen items. The calculator substitutes the factorial values and performs the division.

2

What the step-by-step shows

The step-by-step view expands every factorial into its factors before dividing. For 8P3 it writes 8! as 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1, cancels the shared 5 x 4 x 3 x 2 x 1 against the denominator, and is left with 8 x 7 x 6 = 336. For 8C3 it leaves 8 x 7 x 6 over 3 x 2 x 1, or 336 / 6 = 56. Every line restates a step you could redo by hand.

Good uses

  • Figuring out lottery or raffle odds: counting how many distinct ticket or winner possibilities exist, ordered or not, before converting that count into a probability.
  • Planning teams and menus: choosing a committee of 3 from 8 candidates, 2 pizza toppings from 9, or a hand of cards from a deck - any selection where the group is what counts, not the order.
  • Checking homework or a published statistic: confirming a probability denominator, such as the 52C5 = 2,598,960 five-card hands in a deck that poker odds are built on.

Limits and checks

  • Order decides everything. nPr and nCr for the same n and r differ by a factor of r!, so deciding whether order matters is part of the input, not a detail. A committee is nCr; a ranked prize list is nPr.
  • r must be no larger than n. The formulas involve a negative factorial otherwise, and there are genuinely zero ways to choose more items than the set holds. Check which field got which number before reading the answer.
  • The symmetry nCr = nC(n - r) can look like a bug: 8C3 and 8C5 are both 56, because choosing 3 people to keep leaves 5 out. And large results are usually right - 30C15 is 155,117,520.

Common questions

Why is nPr so much larger than nCr for the same numbers?

Every set of r chosen items can be arranged in r! different orders, and nPr counts each arrangement separately, while nCr counts the set once. So nPr = nCr x r! exactly, every time: for n = 8, r = 3, that is 56 x 6 = 336. The gap widens fast because r! grows faster than any fixed multiplier.

Can I get my lottery odds from this?

You get the denominator, which is the hard part. A game drawing 6 balls from 49 has 49C6 = 13,983,816 possible tickets, so one entry wins with probability 1 in 13,983,816. Converting that count into odds or a percentage is on you, and you must check the game rules first: with replacement, or with order counted, the formula changes.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools