Asistente RD

Combinations and permutations calculator

Compute combinations C(n,r), permutations P(n,r) and the factorial n! with exact BigInt precision. Learn when order matters. Free, no sign-up.

Free · No sign-up · In your browser

Enter how many items you have (n) and how many you pick (r). The calculator shows the combinations, the permutations and the factorial n!, giving the exact integer thanks to BigInt.

Combinations C(n, r)

13,983,816

Order does NOT matter

Permutations P(n, r)

10,068,347,520

Order DOES matter

Factorial n!

608,281,864,034,267,560,872,252,163,321,295,376,887,552,831,379,210,240,000,000,000

Ways to arrange all n items

Which one do I use?

If the order of the chosen items is irrelevant, use combinations (lottery numbers, a committee). If order changes the outcome, use permutations (a race podium, a PIN).

Share on WhatsApp Last reviewed: July 9, 2026

What combinations and permutations are

Combinations and permutations answer almost the same question with one decisive twist: from a set of n items, how many ways can you choose r? The difference is whether order counts. In a combination, order is irrelevant — picking Ann and then Ben gives the same group as picking Ben and then Ann. In a permutation, order matters — first and second place in a race are not interchangeable.

The factorial of a number, written n!, is the product of every integer from 1 up to n (for instance 5! = 5 × 4 × 3 × 2 × 1 = 120). It is the building block of both formulas, and on its own it counts how many ways you can arrange all n items in a row.

This calculator runs on BigInt, so it prints the exact whole number even when n is large and the answer has dozens of digits — no rounding and no overflow like the ones ordinary calculators hit.

How to use the calculator

  1. Enter the total number of available items in n.
  2. Enter how many you will choose in r. It must hold that r is not greater than n.
  3. Read the three cards: combinations, permutations, and n!. They update as you type.
  4. Press Copy results to grab all three numbers at once.

If r is greater than n, or you type something that is not a whole number, the calculator warns you instead of returning a wrong answer.

The formula

Both formulas start from the factorial:

  • Combinations: C(n, r) = n! / (r! · (n − r)!)
  • Permutations: P(n, r) = n! / (n − r)!

The link between them is simple: P(n, r) = C(n, r) × r!. That makes sense, because each combination of r items can be reordered in r! different ways, and those reorderings are exactly what permutations count separately.

AspectCombinationPermutation
Does order matter?NoYes
Formulan! / (r!·(n−r)!)n! / (n−r)!
RelationshipAlways smaller or equalP = C × r!
Typical exampleLottery numbers, a committeePodium, password, ranking
C(5,2) vs P(5,2)1020

Worked example

Picture a 6/49 lottery: six numbers are drawn from 49 and the order they come out in does not matter. That is a combination:

C(49, 6) = 49! / (6! · 43!) = 13,983,816

There are almost 14 million possible tickets, so the chance of matching all six with a single ticket is 1 in 13,983,816.

Now a case where order does count: in a race with 5 runners, how many ways can the gold, silver, and bronze podium be formed? We choose 3 and the order decides the medal, so it is a permutation:

P(5, 3) = 5! / 2! = 120 / 2 = 60

And if only gold and silver are handed out among 5 runners: P(5, 2) = 5! / 3! = 120 / 6 = 20, versus the C(5, 2) = 10 combinations. Exactly double, because r! = 2! = 2.

Frequently asked questions

What is the difference between a combination and a permutation?

In a combination the order of the chosen items changes nothing, so groups with the same members are counted only once. In a permutation each distinct order is a distinct outcome. That is why P(n, r) is always greater than or equal to C(n, r): the permutation counts all the reorderings that the combination lumps together.

Why is the result exact for large numbers?

The tool computes with BigInt, a number type that handles integers of arbitrary size. Calculators that rely on floating-point decimals lose precision past a certain magnitude; here the factorial and both formulas are solved with whole numbers, so the value shown is exact, digit for digit.

What happens if r is greater than n?

Choosing more items than exist is meaningless, so the calculator returns no number and shows a notice asking you to fix the inputs. In the formulas that case would require the factorial of a negative number, which is undefined.

What is the value of 0!?

By convention 0! = 1. It looks odd, but it keeps the formulas consistent: C(n, n) = n! / (n! · 0!) = 1, meaning there is exactly one way to choose all the items. Without 0! = 1 the arithmetic would not line up.

Can I use this for probability?

Yes — it is the first step. To get the probability of an event you divide favorable cases by possible cases, and combinations or permutations give you that total of possible cases. In a 6/49 lottery, for example, one ticket has a 1 in 13,983,816 chance.

Related tools