Skip to content
Math

Permutation & Combination Calculator

A permutation counts selections where order matters, while a combination counts selections where order does not. Choosing three finalists from ten gives 120 combinations; assigning gold, silver, and bronze to three of ten gives 720 permutations because each selected group has six possible orders.

By Updated Runs in your browser — nothing is uploaded

Input · choose r objects from n

Without repetition, r cannot exceed n.

Combinations · order does not matter

120

C(10, 3) = n! ÷ [r!(n−r)!]

Permutations · order matters
720
Sequences with repetition
1,000
Combinations with repetition
220
Combination result digits
3
Permutation result digits
3
On this page
  1. Counting without listing every outcome
  2. Factorials
  3. Permutations without repetition
  4. Combinations without repetition
  5. How to decide whether order matters
  6. Ordered selections with repetition
  7. Combinations with repetition
  8. Worked selection example
  9. Worked probability example
  10. Restrictions change the formula
  11. Circular permutations
  12. Repeated objects in arrangements
  13. Exact integers and display size
  14. Common mistakes
  15. Limits of the calculator

Counting without listing every outcome

Combinatorics asks how many arrangements or selections are possible. Listing outcomes works for tiny examples, but the count grows too quickly for enumeration. Permutation and combination formulas give the total directly.

The first question is whether order matters. The second is whether an object can be selected more than once. Those two choices determine the formula.

This calculator reports four common cases: ordered selection without repetition, unordered selection without repetition, ordered sequences with repetition, and unordered selections with repetition.

Factorials

The factorial of a non-negative integer n is the product of every positive integer through n:

n! = n × (n−1) × (n−2) × … × 2 × 1

For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.

Zero factorial is defined as 1. There is exactly one way to arrange no objects: the empty arrangement. The definition also keeps identities such as C(n,0) = 1 and n! = n × (n−1)! valid at the boundary.

Factorials grow extremely fast. Twenty factorial is already 2,432,902,008,176,640,000. Exact integer arithmetic is necessary when the full count matters.

Permutations without repetition

A permutation counts ordered selections of r distinct objects from n:

P(n,r) = n! ÷ (n−r)!

The factorials cancel, leaving r descending factors:

P(n,r) = n × (n−1) × … × (n−r+1)

Suppose ten runners compete for gold, silver, and bronze. There are ten choices for gold, nine remaining choices for silver, and eight for bronze. The count is 10 × 9 × 8 = 720.

Order matters because the same three runners receiving different medals is a different outcome.

Combinations without repetition

A combination counts unordered selections of r distinct objects from n:

C(n,r) = n! ÷ [r!(n−r)!]

Choosing three committee members from ten gives C(10,3) = 120. Each committee appears 3! = 6 times among the 720 ordered selections, once for every internal order. Dividing permutations by 6 removes those duplicates.

Combinations satisfy a symmetry:

C(n,r) = C(n,n−r)

Choosing three people to include is equivalent to choosing seven to leave out. The calculator uses the smaller of r and n−r to compute the value efficiently.

How to decide whether order matters

Ask whether swapping the selected objects changes the outcome. A password, race ranking, seating order, and sequence of tasks change when positions swap, so they use permutations.

A committee, lottery set, hand of cards, and chosen feature set normally do not change when listed in another order, so they use combinations.

Labels can create order even without a physical line. Assigning three people to three different jobs is a permutation because the roles distinguish positions. Selecting three people for identical membership is a combination.

Ordered selections with repetition

When each of r positions can independently use any of n objects, the count is:

n^r

A four-digit code using ten digits has 10^4 = 10,000 possible sequences when leading zero and repeated digits are allowed. Each position has ten choices, and the multiplication rule combines them.

If repetition is forbidden, the same code-shaped selection has P(10,4) = 5,040 outcomes. Clarifying replacement or repetition can therefore change the answer substantially.

Combinations with repetition

For an unordered selection of r items from n types where a type can appear multiple times, the count is:

C(n+r−1,r)

This is the stars-and-bars formula. Imagine r identical stars representing selected items and n−1 bars separating them into categories. Arranging the stars and bars determines how many of each type were selected.

Choosing six identical scoops among four flavours, where only the number of each flavour matters, gives C(4+6−1,6) = C(9,6) = 84.

If individual scoops are ordered in a sequence, use 4^6 instead. Again, order is the deciding question.

Worked selection example

A class has 12 students and needs a four-person group. If every member has the same status:

C(12,4) = 495

If the group has four distinct positions—leader, recorder, presenter, and reviewer—the count is:

P(12,4) = 12 × 11 × 10 × 9 = 11,880

There are 4! = 24 role assignments for every four-person group, and 495 × 24 = 11,880.

Worked probability example

A standard deck has 52 cards. The number of five-card hands is C(52,5) = 2,598,960 because hand order does not matter.

To count hands containing exactly two aces, choose two of the four aces and three of the 48 non-aces:

C(4,2) × C(48,3) = 6 × 17,296 = 103,776

The probability is favourable combinations divided by total combinations: 103,776 ÷ 2,598,960, about 3.9937%.

This example also shows that complex counts are often products of smaller independent choices.

Restrictions change the formula

Basic formulas assume every object is available for every relevant choice. Restrictions may require splitting the problem into cases, subtracting forbidden outcomes, or using inclusion-exclusion.

If a five-character code must include at least one digit, count all allowed-character codes and subtract codes containing no digits. Counting the complement is often simpler than counting every valid case directly.

If two people cannot serve together on a committee, calculate all committees and subtract those containing both. The subtracted count fixes those two members and chooses the remaining places from everyone else.

The calculator does not model custom restrictions; it supplies the standard building blocks.

Circular permutations

Arranging n distinct objects around a circle differs from arranging them in a line. Rotating everyone together does not create a new relative order, so fix one object as an anchor and arrange the rest:

circular arrangements = (n−1)!

If mirror images are also considered the same, as with an unoriented necklace, an additional division by two may apply for distinct objects. Symmetry and repeated patterns can make necklace counting more complicated.

The nPr result from this calculator describes linear ordered selections, not equivalence under rotation or reflection.

Repeated objects in arrangements

If a full arrangement contains repeated indistinguishable objects, divide by the factorial of each repetition count:

n! ÷ (a!b!c!…)

The letters in LEVEL have five positions with L repeated twice and E repeated twice. The number of distinct arrangements is 5! ÷ (2!2!) = 30.

Treating identical copies as distinct would count visually identical arrangements several times. This case differs from selecting with replacement and is not one of the four direct outputs.

Exact integers and display size

Counting results are whole numbers. Floating-point approximations can lose units once results exceed the safe-integer range. The calculator uses arbitrary-precision integers and never routes the count through a decimal approximation.

For very large results, the display shortens the middle while reporting the digit count. The computation itself remains exact. Inputs are limited to n of 500 to keep output and browser work practical.

Scientific notation can be useful for scale but is not suitable when the exact count is required for modular arithmetic, enumeration boundaries, or a proof.

Common mistakes

The most common mistake is choosing permutation because the selected items are written in a list, even though rearranging the list does not change the outcome. Written order is not necessarily meaningful order.

Another is using n^r when repetition is forbidden. Independent choice at every position assumes previously selected objects remain available.

A third is forgetting that roles create distinct positions. “Choose a chair and deputy” is ordered even if the two names are later printed alphabetically.

Finally, factorial cancellation should be done before numeric approximation. Computing huge factorials as floating-point numbers and dividing them can overflow or round an integer result.

Limits of the calculator

The tool handles standard selections from n types or distinct objects with n and r between zero and 500 and r no greater than n for the without-repetition cases.

It does not directly handle circular symmetry, repeated indistinguishable objects in a full arrangement, custom exclusions, adjacency rules, minimum counts, or probability weighting. Those problems can often be assembled from combinations, products, sums, and complementary counting.

Use the output as an exact count under the stated assumptions. Before applying it, describe what makes two outcomes different and whether a selected object returns to the available pool.

Common questions

Frequently asked questions

What is the difference between permutations and combinations?

Permutations treat different orders as different outcomes; combinations do not. Selecting Alice, Ben, and Chen as a committee is one combination. Assigning them president, secretary, and treasurer produces six permutations because the roles create distinct orders.

What does nPr mean?

nPr is the number of ordered selections of r distinct objects from n without repetition. It equals n! ÷ (n−r)!, or the product n × (n−1) through r factors. It applies to rankings, arranged roles, and ordered sequences.

What does nCr mean?

nCr is the number of unordered selections of r objects from n without repetition. It equals n! ÷ [r!(n−r)!]. Dividing by r! removes the internal orders that represent the same selected group.

How does repetition change the count?

For ordered sequences of length r drawn from n choices with replacement, the count is n^r. For unordered selections with repetition, the count is C(n+r−1, r), often explained with the stars-and-bars method.

Why is 0 factorial equal to 1?

There is exactly one way to arrange zero objects: the empty arrangement. Defining 0! as 1 also keeps factorial identities and combination formulas consistent, including C(n,0)=1 and C(n,n)=1.

Why are permutation and combination results so large?

Factorial growth is extremely fast. Arranging 20 distinct objects already gives 20! = 2,432,902,008,176,640,000. Exact integer arithmetic is needed because ordinary floating-point numbers cannot represent all large counts without rounding.

References

Sources and verification

The formulas and reference ranges on this page come from the following publications. Where a source has been revised, we cite the current edition and update the page when the underlying method changes.

  1. 1Digital Library of Mathematical Functions — Combinatorial AnalysisNational Institute of Standards and Technology
  2. 2NIST Dictionary of Algorithms and Data Structures — permutationNational Institute of Standards and Technology
This page cites 2 references. See how formulas, examples, updates, and corrections are handled in our editorial policy, or report a possible error.

Keep going

After using the Permutation & Combination Calculator, these are the closest tools for checking a related number, comparing a result, or continuing the same calculation.