Skip to main content
100% Free • No Sign-up • AdSense-grade original content

Combinations Calculator

Calculate nCr combinations and permutations instantly.

Combinations & Permutations Calculator

Enter n (total items) and r (items to choose). Both nCr and nPr are calculated.

Combinations (nCr)

Order doesn't matter

Permutations (nPr)

Order matters

Formulas: nCr = n!/(r!(n−r)!) · nPr = n!/(n−r)!

How the Combinations Calculator works

The Combinations Calculator computes both nCr (combinations, where order does not matter) and nPr (permutations, where order matters) for any non-negative integers n and r. Enter the total number of items (n) and how many you want to choose (r), and the calculator returns both values along with the factorial computations used in the calculation.

The formulas

Combinations (nCr) — order does not matter

nCr = n! ÷ ( r! × (n − r)! )

"How many ways can I choose r items from n items, if order does not matter?"

Permutations (nPr) — order matters

nPr = n! ÷ (n − r)!

"How many ways can I arrange r items from n items, if order matters?"

Factorial

n! = n × (n−1) × (n−2) × ... × 2 × 1, with 0! = 1

Worked examples

Combinations: How many ways to choose 3 students from a class of 10? C(10, 3) = 10! ÷ (3! × 7!) = 3628800 ÷ (6 × 5040) = 120.

Permutations: How many ways to arrange 3 students in a line from a class of 10? P(10, 3) = 10! ÷ 7! = 3628800 ÷ 5040 = 720.

Notice that P(10, 3) = C(10, 3) × 3! = 120 × 6 = 720. This makes sense: for each combination of 3 students, there are 3! = 6 ways to arrange them in a line.

When to use which

The choice between combinations and permutations hinges on one question: does order matter? If yes, use permutations. If no, use combinations. Some examples:

A useful test: ask yourself "if I swap two of the chosen items, is it a different result?" If yes (race positions, passwords, shelf arrangements), use permutations. If no (committees, toppings, lottery picks), use combinations. Getting this distinction right is essential — using the wrong one gives an answer that is off by a factor of r!, which can be enormous.

Factorial growth

Factorials grow astonishingly fast. 5! = 120, 10! = 3,628,800, 20! = 2.4 × 10¹⁸, and 70! exceeds the number of atoms in the observable universe. This is why brute-force algorithms that try every permutation of even 20 items are computationally infeasible — and why clever algorithms (sorting, searching, optimization) are so valuable. The factorial\'s explosive growth also explains why large random samples behave so predictably: with 100 items, the number of possible orderings is so vast that almost any specific arrangement is vanishingly unlikely, which is the foundation of statistical reasoning.

Frequently asked questions

Combinations (nCr) count selections where order does NOT matter. Permutations (nPr) count arrangements where order DOES matter. Choosing 3 friends from 10 = C(10,3) = 120. Arranging 3 friends in a line from 10 = P(10,3) = 720.

nCr = n! ÷ (r! × (n−r)!). nPr = n! ÷ (n−r)!. Where n! (n factorial) = n × (n−1) × ... × 1.

Use combinations when order does not matter: choosing a team, picking lottery numbers, selecting dishes. Use permutations when order matters: arranging books on a shelf, race rankings, password generation.

0! = 1 by convention. This makes the formulas work correctly for edge cases like C(n, 0) = 1 (there is exactly one way to choose nothing).

Factorials grow extremely fast. 20! is already 2.4 quintillion. This calculator handles up to n=170 reliably; beyond that, results exceed JavaScript's number precision.

Ready to ace your next semester?

Join thousands of students using Ahasn.xyz to track grades, plan studies, and reach academic goals — completely free.