CT Calc Tools

Combinations & Permutations Calculator

Calculate combinations (nCr), permutations (nPr) and factorials with the formula expanded for each result.

🔒 Runs entirely in your browser — nothing is uploaded

Result

—

Enter values to calculate.

Advertisement

Counting with factorials

Combinatorics answers the question "how many ways?" and it is built on the factorial. The factorial of n, written n!, multiplies every whole number from 1 up to n, and by definition 0! = 1. A factorial counts how many ways you can arrange n distinct items in a row: there are 5! = 120 orderings of five different books on a shelf. Factorials grow extremely fast, which is why even modest values produce huge counts. This calculator shows the factorial directly and also uses it inside the combination and permutation formulas.

Permutations count ordered selections. Choosing r items from n where order matters uses nPr = n! ÷ (n − r)!. Combinations count unordered selections, where a group is the same regardless of order, and use nCr = n! ÷ (r! × (n − r)!). Because every combination can be arranged in r! orders, the two are linked by nPr = nCr × r!. That is why permutations are always greater than or equal to the matching combinations. The widget expands the chosen formula under the answer so you can follow exactly how the count was produced.

When to use each

Use permutations when order matters: finishing positions in a race, seat arrangements, PIN digits, or the order songs play in a playlist. Use combinations when order does not matter: lottery picks, a hand of cards, choosing a committee, or selecting toppings for a pizza. A quick test is to ask whether swapping two chosen items creates a genuinely different outcome — if yes, it is a permutation; if no, it is a combination. Remember that r cannot exceed n, since you cannot pick more items than exist, and the calculator validates that for you. Because results rely on standard JavaScript numbers, very large factorials become approximate and eventually overflow to infinity, but for typical probability, statistics and homework problems the values are exact and computed entirely on your device.

How to use

  1. Choose an operationPick combinations (nCr), permutations (nPr) or a single factorial (n!).
  2. Enter n and rType the total items n and, for nCr or nPr, how many you choose, r. The r field hides for factorials.
  3. Read the countThe result and the expanded formula update instantly so you can check the working.

Frequently asked questions

What is the difference between nCr and nPr?
Permutations (nPr) count ordered selections, so ABC differs from CBA. Combinations (nCr) count unordered selections, so ABC and CBA are the same group. That is why nCr is always less than or equal to nPr.
What is a factorial?
n! is the product of every whole number from 1 to n, with 0! defined as 1. It counts the number of ways to arrange n distinct items in order.
Why must r be no larger than n?
You cannot choose or arrange more items than you have, so r must be between 0 and n. The calculator flags inputs outside that range.
How large can the numbers be?
Results use standard JavaScript numbers, so very large factorials become approximate beyond about 18! and may show as infinity past 170!. Everything is computed locally in your browser.
Advertisement