Permutation & Combination Calculator

Calculate the number of permutations or combinations of r items chosen from n, with and without repetition, and the full factorial.

How to use this calculator

  1. 1Enter the pool size (n) and how many you are choosing (r).
  2. 2Switch on repetition if an item can be picked more than once.
  3. 3Use permutations when order matters, combinations when it does not.

How the calculation works

nPr = n! / (n − r)! nCr = n! / (r!(n − r)!)
n
The total number of items to choose from
r
The number chosen
!
Factorial — the product of every whole number from 1 up to that number

Factorials are computed via the Lanczos approximation to the log-gamma function rather than direct multiplication, so results stay exact for n well beyond 170 — the point where a direct factorial overflows a standard double-precision number.

Combinations are permutations divided by r!, because every group of r items can be arranged in r! different orders, and combinations do not distinguish between them.

With repetition, combinations use the "stars and bars" formula (n+r−1)Cr rather than nCr.

Worked example

Choosing 3 from 10, no repetition

  1. 1.Permutations: 10! ÷ (10−3)! = 10 × 9 × 8 = 720.
  2. 2.Combinations: 720 ÷ 3! = 720 ÷ 6 = 120.
  3. 3.Each group of 3 can be arranged 3! = 6 ways, which is exactly the ratio between the two results.

Result: 720 permutations, 120 combinations

Two ways of counting

Permutations and combinations both count how many ways you can choose r items from a group of n — the entire difference between them is whether the order of selection matters. A permutation treats first, second and third place as different outcomes even with the same three people; a combination treats any group of the same three people as identical, no matter what order they were picked in.

That single distinction is why the two formulas differ by a factor of r! (r factorial): every group counted once by combinations corresponds to r! different orderings counted separately by permutations — the number of ways to arrange that group among itself.

Why the count explodes so fast

Because factorials multiply every whole number up to n, totals grow far faster than intuition expects. Arranging just 10 items already has 3,628,800 possible orders, and a standard 52-card deck can be shuffled into vastly more distinct sequences than there are atoms in the observable universe, with only 52 items to arrange.

Combinations grow more slowly than permutations, since dividing out the r! internal orderings collapses a huge number of arrangements down to one — but the underlying count is still large enough that lottery-style odds, choosing a handful of numbers from a few dozen, routinely run into the tens of millions.

Where this shows up

The two ideas turn up anywhere a fixed set of items needs to be chosen or arranged.

  • Passwords and PINsusually allow repetition, so a 4-digit PIN has 10⁴ possibilities rather than a permutation of 10 digits.
  • Card and board gamesthe odds of a specific hand are almost always a combinations question, since the order the cards were dealt in does not change the hand.
  • Lottery oddsthe classic "how many possible ticket combinations" calculation behind published lottery odds.
  • Scheduling and logisticscounting how many ways a fixed set of tasks, routes or shifts can be ordered.
  • Genetics and molecular biologycounting possible arrangements of a fixed set of components, from DNA sequences to protein folding studies.

The mix-up almost everyone makes

The most common error involves the everyday combination lock on a gym locker. Because entering the numbers in the wrong order will not open it, it is technically a permutation lock — the name "combination lock" has simply stuck through long-standing convention rather than mathematical accuracy.

The safest way to tell the two apart in a word problem is to ask: if the same items were chosen in a different order, would that count as a different outcome? If yes, it is a permutation. If the same items in any order still count as the same result, it is a combination.

What this assumes, and where it stops

Assumptions

  • n and r are non-negative whole numbers, with r ≤ n unless repetition is allowed.

Limitations

  • Values above 1000 are rejected, since the results become too large to display meaningfully even in scientific notation terms that mean anything to a person.

Common questions

What is the difference between a permutation and a combination?

Order. A permutation counts arrangements — first, second, third place are different outcomes. A combination counts groups — the same three people on a committee are the same committee regardless of who was picked first. Choosing a 3-digit lock code is permutations (147 differs from 174); choosing 3 lottery numbers is combinations (the same three numbers win regardless of draw order).

How do I calculate a factorial?

Multiply every whole number from 1 up to n: 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention 0! = 1, which keeps the permutation and combination formulas consistent when r = 0 or r = n.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the permutation & combination calculator.

See all statistics calculators →