Skip to content
ToolPaxaAll Tools for Everyone, in One Place.All calculators

Permutation and Combination Calculator

Count selections with or without order and repetition. Enter n and r in the formula, and see the exact count, all four model counts and calculation steps.

Formula reference

C(n,r)=n!/[r!(n−r)!]; 0≤r≤n

All formulas
  • C(n,r)=n!/[r!(n−r)!]; 0≤r≤n
  • P(n,r)=n!/(n−r)!; 0≤r≤n
  • O(n,r)=nʳ; n>0
  • U(n,r)=C(n+r−1,r); n>0
  • n,r∈ℤ; 0≤n≤10¹²; 0≤r≤10⁴
  • n!=∏(k=1…n)k; 0!=1
  • C(n,r)=C(n,n−r); P(n,r)=r!C(n,r); 0≤r≤n
  • r>n ⇒ C(n,r)=P(n,r)=0
  • r=0 ⇒ C=P=O=U=1, n≥0
  • n=0,r>0 ⇒ C=P=O=U=0
  • n>0: U(n,r)=#{(k₁,…,kₙ)∈ℤⁿ:kᵢ≥0,Σkᵢ=r}
  • O(n,r)≥U(n,r), n,r≥0
!
! (n−r)!
= ?

Your result

Your answer and calculation steps appear here.

Inputs and calculations stay in this browser tab. Copy or export your report before closing.

Permutations and combinations: choose the right model

Enter whole nonnegative numbers without commas, decimal points or scientific notation. n is the number of distinct available items or types;r is the number selected or the sequence length. Choose whether order matters and whether repetition is allowed. Empty selections count as one;impossible no-repeat selections count as zero.

Decide what makes two outcomes different

The same n and r can describe different counting questions. Order matters when positions or roles are distinguishable: selecting A then B is different from selecting B then A. Order does not matter for an unlabelled group. Repetition means the same item type can be chosen again;without repetition, each distinct item is used at most once. These are separate decisions. A set of distinguishable people, a sequence of symbols and a multiset of reusable types therefore need different modes. The tool assumes no additional restrictions on adjacency, capacity or required members.

Compare nCr and nPr without repetition

For 0≤r≤n, combinations use C(n, r)=n!/[r!(n−r)!] and permutations use P(n, r)=n!/(n−r)!. With eight distinct people and three unlabelled places, C(8,3)=56 groups are possible. For three distinct roles, P(8,3)=336 assignments are possible. Each group has 3!=6 orders, so 336=56×6. The paired result helps compare these models. Dividing by r! is valid here because all chosen items are distinct and every r-item group has the same number of orders.

Allow repetition only when the problem allows it

An ordered sequence of r positions, each having n reusable choices, has nʳ outcomes. With five symbols and four positions, the ordered count is 5⁴=625. An unordered selection of four items from five reusable types has C(5+4−1,4)=C(8,4)=70 multisets. That formula assumes unlimited reuse of each type and ignores the order of selection. It is also the count of nonnegative type counts summing to r. Limited stock, indistinguishable roles or restrictions such as no equal adjacent symbols require a different model.

Understand empty and impossible selections

Choosing zero items gives one outcome:the empty selection or sequence. All four modes therefore return 1 for r=0, including n=0. This is a counting convention for an empty object, not a claim that a general numerical calculator must define 0⁰. With n=0 and r>0, there are no outcomes, so the count is 0. Without repetition, r>n is impossible and both nCr and nPr are 0. With repetition, r can exceed n;for two types and three positions, the ordered count is 8 and the unordered count is 4.

Keep large counts exact and recognise the bounds

The supported inputs are integers 0≤n≤10¹² and 0≤r≤10,000. The calculator uses exact integer products and cancellations, not rounded factorial approximations. A requested count may contain up to 40,000 decimal digits. If it is longer, the tool returns an explicit work-limit error. A comparison count can exceed that cap even when the requested count fits:its cell then shows the proven lower bound >10^40000−1. That bound is not the full count. Long supported values stay intact in the report;the shortened primary number is only a preview.

Use counts responsibly and keep the full report

A count is not automatically a probability. Dividing favourable outcomes by all outcomes requires a consistent sample space with equally likely outcomes;the selection procedure matters. Changing from order-sensitive to order-insensitive counting can otherwise mix incompatible outcomes. These counts also do not account for real-world eligibility or inventory rules unless those rules match the chosen mode. Review the stated assumptions, compare the four counting models, then expand the full integer or copy, download CSV or print the report with its formulas and inputs.

Use Probability Calculator when converting suitable counts into probabilities under an explicit equally likely model. Big Number Calculator explores factorials and other exact arithmetic; Exponent Calculator explains repeated-choice powers. Scientific Calculator supports related calculations, and Random Number Generator can generate numeric labels within its own limits.

ISO 80000-2:2019 supplies mathematical notation context, not certification of this tool. NIST DLMF — Binomial Coefficients defines binomial coefficients, their symmetry and impossible-selection convention. NIST DLMF — Permutations describes permutations, and NIST DLMF — Factorial and Common Notation provides factorial notation. The chosen counting model and empty-selection rules are stated explicitly on this page.

Common questions

What is the difference between a permutation and a combination?

A permutation distinguishes order or roles; a combination does not. Without repetition, P(n, r)=r!C(n, r). The mode must match what counts as a different outcome in your problem.

Can this calculate repeated choices?

Yes. Ordered repetition uses nʳ;unordered repetition uses C(n+r−1, r) for n>0. Unlimited reuse is assumed. The n=0 and r=0 boundaries are handled explicitly.

Why does choosing zero items give one?

There is exactly one empty selection or empty sequence. This includes choosing zero items from an empty set and is separate from general numerical conventions for 0⁰.

Why is r greater than n sometimes zero?

Without repetition, you cannot select more distinct items than are available. With repetition, you can reuse types, so r may exceed n. Choose the appropriate mode.

What does >10^40000−1 mean?

The paired count is larger than the supported 40,000-digit output cap. The cell gives a proven lower bound, not an approximate full count. The requested count must fit the cap to return a successful result.

Are large results exact, and are inputs uploaded?

Supported counts are exact integers. Long displays are previews, while the full values remain available for copy, CSV and print. Calculation runs in your browser without uploading the inputs for computation.

Explore related tools