Maths

Permutation and Combination Calculator

Count the ways to choose or arrange r items from n, with or without repeats, exactly.

By Nitin Raturi · Last reviewed

Your selection

How to use the Permutation and Combination Calculator

Count the ways to choose or arrange r items from n, exactly.

  1. Enter the total number of items.
  2. Enter how many are chosen.
  3. Say whether order matters and whether items can repeat.
  4. Read the count, with all four variants beneath.

Good to know

  • If swapping two picks gives a different outcome, order matters.
  • Counts are exact, even when they run to thousands of digits.

Counts are exact at any size.

Total items (n)

How many different items you are choosing from.

How to fill it in

  • Enter a whole number from 0 to 1,000.

Example

A deck has 52 cards; there are 25,98,960 five-card hands.

Items chosen (r)

How many items go in each selection or arrangement.

How to fill it in

  • Enter a whole number from 0 to 1,000.
  • Without repeats, it cannot be more than the total.

Example

Choosing 3 of 10 gives 120 groups.

Does order matter?

Does order matter?

A permutation counts each order separately; a combination counts each group once.

How to fill it in

  • Choose permutation for rankings, codes and seating.
  • Choose combination for teams, hands and committees.

Example

3 of 10 in order gives 720; as groups, 120.

Can items repeat?

Can items repeat?

Whether the same item can be picked more than once.

How to fill it in

  • Choose yes for PINs and dice; no for people and cards.

Example

A 4-digit PIN allows repeats: 10,000 codes.

Number of combinations

120

There are 120 selections of 3 from 10.

nPr (order, no repeats)
720
nCr (no order, no repeats)
120
nʳ (order, repeats)
1,000
C(n + r − 1, r) (no order, repeats)
220

nCr = n! ÷ (r! (n − r)!). Every count is exact; long ones are summarised.

How this calculator works

  1. Step 1Countn and rItems to choose from, and items chosen.
  2. Step 2Order?nPr or nCrRankings and codes count each order; groups do not.
  3. Step 3Repeats?nʳ or C(n+r−1, r)Whether one item can be picked twice.

Two questions decide the count: does the order of the picks matter, and can the same item be picked again?

The calculator works in exact whole-number arithmetic, so even counts with thousands of digits are right to the last digit.

Worked example: 3 from 10

Choosing 3 of 10 items
Permutations
nPr = n! ÷ (n − r)!
Combinations
nCr = nPr ÷ r!
  • nItems to choose from 10
  • rItems chosen 3
  1. In order10 × 9 × 8720
  2. Orders of each group3! = 3 × 2 × 16
  3. Groups720 ÷ 6120

Each group of 3 can be lined up in 6 orders, so there are six times as many permutations as combinations.

Familiar counts

  • Five-card hands25,98,96052C5: order does not matter.
  • 6-from-49 draw1,39,83,81649C6: one ticket covers one group.
  • 4-digit PIN10,00010⁴: order matters, digits repeat.

Read the result

The answer counts outcomes. For a probability, divide the outcomes you want by this total.

All four variants are listed beneath the answer, so you can compare them without changing the settings.

Assumptions and limits

  • Distinct itemsEach of the n items is different.
  • r ≤ nWithout repeats, you cannot pick more than there are.
  • ExactWhole-number arithmetic up to n = 1,000.
  • Long countsOver 21 digits, shown as a power of ten with the digit count.

Counting the ways something can happen is the first step to its probability.

To turn counts into chances, use the probability calculator or the binomial distribution calculator. For very large factorials, the big number calculator keeps every digit.

Common mistakes

  • Mistake: Using permutations for a team.

    Instead: A team is the same whatever the order: use combinations.

  • Mistake: Forgetting repeats in a PIN.

    Instead: Digits can repeat, so a 4-digit PIN has 10⁴ codes.

  • Mistake: Multiplying all n items.

    Instead: Stop after r factors: 10 × 9 × 8 for 3 of 10.

Checking the method

Every golden case is re-worked from Pascal's triangle, built row by row.

An independent script builds Pascal’s triangle to row 220 and multiplies factorials directly, then compares all four counts.

Read how we test our calculators, or browse more maths calculators.

Frequently asked questions

What is the difference between a permutation and a combination?

Permutations count each order separately; combinations count each group once. 3 of 10 gives 720 permutations but 120 combinations.

What is the nCr formula?

nCr = n! ÷ (r! × (n − r)!). It divides the ordered count by the r! ways to order each group.

How many five-card poker hands are there?

52C5 = 25,98,960, because the order you receive the cards in does not matter.

How do repeats change the count?

With repeats and order, the count is nʳ: a 4-digit PIN has 10,000 codes. Without order it is C(n + r − 1, r).

Why can r not be bigger than n?

Without repeats you run out of items. Allow repeats if the same item can be picked more than once.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 3 Nov 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release.