Factorial and combinations calculator

Choose what you want to find out and enter n (and r for permutations and combinations). The tool gives the exact answer and shows the formula. You can pick the factorial n!, the number of permutations (ordered choices) or the number of combinations (choices without order), each with or without repetition.

What do you want to calculate?

A whole number from 0 to 5,000.

A whole number from 0 to 5,000.

Fill in the fields; the answer appears here straight away.

How it works

  1. Enter the values

    Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.

  2. Instant answer

    The answer appears as you type, with the most important intermediate values.

  3. See the working

    Under "How it's worked out" you see the steps, handy for checking your own calculation.

The three calculations

What Formula Example
Factorial n! = n × (n − 1) × … × 1 6! = 720
Permutations P(n, r) = n! ÷ (n − r)! P(10, 3) = 720
Combinations C(n, r) = n! ÷ (r! × (n − r)!) C(10, 3) = 120

With repetition, the number of permutations is simply n^r, and the number of combinations is C(n + r − 1, r).

Probability in practice

  • A lottery where you pick 6 numbers from 59 has C(59, 6) = 45,057,474 possible outcomes, so one line has a 1 in 45 million chance.
  • A 5-card poker hand from 52 cards can be dealt in C(52, 5) = 2,598,960 ways.
  • A deck of 52 cards can be shuffled in 52! ≈ 8.07 × 10^67 ways. Almost every well-shuffled deck that has ever existed is therefore unique.
  • Eight people at a round table can be seated in 7! = 5,040 ways, because rotating the whole table is not a new arrangement.

Tips

Start every problem with two questions: does the order matter, and may an item be chosen more than once? The answers decide which formula you need. To show a probability as a percentage, divide the number of favourable outcomes by the total and convert it with the percentage calculator. For the fast growth of powers, as with repetition, the exponent calculator helps.

A factorial grows faster than any power: 10! is already 3,628,800 and 20! is more than 2.4 quintillion. That is why working it out by hand soon becomes impossible, and why a tool like this is handy.

Frequently asked questions

What is a factorial?

n! is the product of all whole numbers from 1 up to n. So 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention 0! = 1, which fits the formulas for permutations and combinations: there is exactly one way to arrange nothing.

What is the difference between a permutation and a combination?

In a permutation the order matters, in a combination it does not. Choosing 3 people from 10 for the roles of chair, secretary and treasurer is a permutation: P(10, 3) = 720. Choosing them for a committee without roles is a combination: C(10, 3) = 120.

When should I allow repetition?

When the same item may be chosen more than once. A 4-digit PIN from 10 possible digits is a permutation with repetition: 10^4 = 10,000. Three scoops of ice cream from 5 flavours, where you may repeat a flavour, is a combination with repetition: C(5 + 3 − 1, 3) = 35.

How large can the numbers be?

Both n and r can go up to 5,000. The tool works with exact big integers, so 25! = 15,511,210,043,330,985,984,000,000 comes out digit for digit. If the result is longer than 120 digits, we show scientific notation and the number of digits.