Clever Quest Lab Tools

Permutation & Combination Calculator

2026-10-06

Enter n items and r chosen to get permutations and combinations, with and without repetition, as exact numbers with the formula and the working. A helper picks the right case, and small cases are listed outcome by outcome.

Your numbers

Whole number, 0 to 10,000.
Whole number, 0 to 10,000.
Separate names with commas. n becomes the number of names.

Examples

Which one do I need?

Does the order matter?
Can an item be chosen more than once?

Results

Factorials

List the outcomes

Everything is calculated in your browser. Nothing you enter is sent anywhere.

How to use the permutation and combination calculator

  1. Type n, the number of items you choose from, and r, the number you choose. Both are whole numbers from 0 to 10,000. An example chip fills in a typical case.
  2. Read the four results. Each shows its formula, your numbers put into it, the shortened product and the exact value with its digit count.
  3. Answer the two questions under "Which one do I need?" to highlight the matching result and see an everyday example.
  4. Optionally enter your own item names separated by commas; n then becomes the number of names. When the highlighted case has at most 500 outcomes, the calculator lists them all.

Permutation or combination?

A permutation is an arrangement in which order matters. Awarding gold, silver and bronze to three of eight runners gives permutations: Ana, Ben, Cy is a different result from Ben, Ana, Cy. A combination is a selection in which order does not matter. Picking three of the eight runners for a relay team gives combinations, because the same three people form the same team however you list them.

Two questions decide the formula: does order matter, and may an item be used more than once? The four answers give four cases, shown here for n = 10 and r = 3.

CaseFormulaWhen it appliesValue
Permutations, no repetitionn! ÷ (n − r)!Ordered, each item once: podium places720
Permutations with repetitionn^rOrdered, items may repeat: PIN codes1,000
Combinations, no repetitionn! ÷ (r! × (n − r)!)Unordered, each item once: lottery, card hands120
Combinations with repetitionC(n + r − 1, r)Unordered, items may repeat: scoops of ice cream220

How it works

n! (n factorial) is n × (n − 1) × … × 2 × 1, the number of ways to line up n different items. By definition 0! = 1: there is exactly one way to arrange nothing, and it keeps n! = n × (n − 1)! true, since 1! = 1 × 0!. For example 20! = 2,432,902,008,176,640,000.

Permutations without repetition. The first place can be filled in n ways, the second in n − 1 ways, and so on for r places: n × (n − 1) × … × (n − r + 1) = n! ÷ (n − r)!. The factors from n − r down to 1 cancel, which is the shortened product the calculator shows. With repetition every place has n choices, so the count is n × n × … × n = n^r.

Combinations without repetition. Every set of r items can be arranged in r! orders, and a permutation count treats each order as different. Dividing removes the duplicates: C(n, r) = P(n, r) ÷ r!, which equals n! ÷ (r! × (n − r)!). With repetition, the "stars and bars" argument applies: r identical stars are split into n groups by n − 1 bars, and choosing which of the n + r − 1 positions hold stars gives C(n + r − 1, r).

If r is larger than n, you cannot pick r different items from n, so both counts without repetition are 0. For r = 0 there is one selection, the empty one, so every result is 1. The calculator multiplies and divides step by step with BigInt integers, so every digit is exact.

Examples

Podium. Eight runners, three medal places: n = 8, r = 3, order matters, no repeats. 8 × 7 × 6 = 336.

Lottery. Six numbers from 49: n = 49, r = 6, order irrelevant. (49 × 48 × 47 × 46 × 45 × 44) ÷ (6 × 5 × 4 × 3 × 2 × 1) = 10,068,347,520 ÷ 720 = 13,983,816.

PIN. A 4-digit code uses n = 10 digits in r = 4 places, repeats allowed: 10 × 10 × 10 × 10 = 10,000.

Ice cream. Three scoops from five flavours, flavours may repeat, order does not matter: n = 5, r = 3, so C(5 + 3 − 1, 3) = C(7, 3) = (7 × 6 × 5) ÷ (3 × 2 × 1) = 210 ÷ 6 = 35.

Pascal's triangle and binomial coefficients

The numbers C(n, r) are also called binomial coefficients, because they are the coefficients in the expansion of (x + y)^n. For instance (x + y)^3 = x^3 + 3x^2y + 3xy^2 + y^3, and 1, 3, 3, 1 are C(3, 0) to C(3, 3). Written in rows they form Pascal's triangle; row 5 is 1, 5, 10, 10, 5, 1, so C(5, 3) = 10. Every entry is the sum of the two above it: C(5, 3) = C(4, 2) + C(4, 3) = 6 + 4.

From a count to a probability

When all outcomes are equally likely, probability = favourable outcomes ÷ all outcomes. A lottery ticket has 6 numbers from 49. Order does not matter, so there are C(49, 6) = 13,983,816 possible tickets and exactly one wins the jackpot: the chance is 1 in 13,983,816, about 0.0000072%. In the same way, 52 cards taken 5 at a time give C(52, 5) = 2,598,960 poker hands, and a single guess at a 4-digit PIN succeeds with probability 1 ÷ 10,000 = 0.01%.

Common mistakes

Frequently asked questions

What is the difference between nPr and nCr?

nPr counts ordered arrangements and nCr counts unordered selections. They are linked by nPr = nCr × r!: 5P3 = 60, 5C3 = 10, and 10 × 6 = 60.

What does the calculator show when r is larger than n?

Permutations and combinations without repetition are 0, with a short explanation. The versions with repetition still work, because an item may be chosen again: for n = 3 and r = 5 they give 243 and 21.

Why is 0! equal to 1?

There is one way to arrange zero items, and defining 0! = 1 makes formulas such as C(n, 0) = n! ÷ (0! × n!) = 1 work.

How large can n be, and are the results exact?

n and r can each be up to 10,000. Results are integers computed with BigInt, so no digit is rounded; C(10,000, 5,000) has 3,009 digits. The scientific-notation line is only a summary, rounded to five significant digits.

When are the outcomes listed?

When the highlighted case has at most 500 outcomes. Items are named A, B, C … (or 1, 2, 3 … beyond 26 items) unless you type your own names.

Is my data sent anywhere?

No. Everything is calculated in your browser. Nothing is uploaded; the page only remembers your last inputs in your browser's local storage.

Related tools