Permutation and Combination Calculator
Calculate nPr and nCr exactly, with or without repetition, for n up to 10,000. Huge answers show every digit plus scientific notation, and small sets are listed.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Permutation and Combination Calculator?
How many ways can 3 runners finish first, second and third out of 8? How many 5-card hands come from a 52-card deck? This calculator answers both kinds of question. Enter the number of items n and how many you pick r, say whether an item can be picked more than once, and it returns the number of permutations (where order matters) and combinations (where it does not) side by side.
Results are exact. The arithmetic uses arbitrary-precision integers, so 52C5 is exactly 2,598,960 and 100C50 is all 30 digits of 100,891,344,545,564,193,334,812,497,256, not a rounded floating-point value. Huge answers also show a scientific-notation summary and a digit count. For small sets it lists every arrangement, using your own item names or A, B, C.
- Permutations and combinations, with and without repetition
- Exact integer results with every digit
- Scientific notation and digit count for huge values
- Lists the arrangements of small sets, with custom item names
- Formulas shown with your n and r
- Copy and share link
How to use the Permutation and Combination Calculator
- Enter the total number of items, n, and the number chosen, r.
- Choose No repetition if each item can be used once (people, lottery balls, cards) or Repetition allowed if items can be reused (digits, letters, flavours).
- Read the permutation and combination counts. For long numbers, the card shows scientific notation and the Exact values panel shows every digit.
- To see the actual arrangements, leave the item names blank to use letters, or type your own names separated by commas.
- Copy the result or share the link.
Worked examples
Podium finishes
Input
n = 8 runners, r = 3, no repetition
Output
8P3 = 336 ordered podiums; 8C3 = 56 groups of three
Gold, silver and bronze are different, so order matters and the permutation count is the answer.
Poker hands
Input
n = 52, r = 5, no repetition
Output
52C5 = 2,598,960
The order you are dealt the cards does not change the hand, so it is a combination.
Lottery odds
Input
n = 69, r = 5, no repetition
Output
69C5 = 11,238,513
This is the white-ball part of a Powerball draw. Multiplying by the 26 possible red balls gives the 292,201,338 jackpot combinations.
Ice cream with repeats
Input
n = 31 flavours, r = 3, repetition allowed
Output
Combinations with repetition: 5,456; permutations with repetition: 29,791
A cup of three scoops ignores order and may repeat flavours. Stacked on a cone where order counts, it is 31³ = 29,791.
Background and insight
A permutation is an ordered selection. Choosing r of n items without repetition gives nPr = n! / (n - r)! permutations: n choices for the first slot, n - 1 for the second, and so on for r slots. A combination ignores order, so each group of r items is counted once instead of r! times: nCr = n! / (r! (n - r)!). That is why 8P3 = 336 but 8C3 = 56, and 336 / 56 = 3! = 6.
With repetition allowed the counts change. Ordered selections with repetition are n^r: a 4-digit PIN from 10 digits has 10⁴ = 10,000 possibilities. Unordered selections with repetition, sometimes called multisets, use the "stars and bars" result C(n + r - 1, r): choosing 3 scoops from 31 flavours, where you may repeat a flavour, gives C(33, 3) = 5,456 possible cups.
Factorials grow faster than exponential functions, so ordinary calculators overflow quickly: 171! is beyond the largest double-precision number. Here n! / (n - r)! is computed as a running product and nCr as a product that divides at every step, so each intermediate value stays an exact integer and the answer for n up to 10,000 arrives in well under a second.
Common use cases
Probability homework
Get the counts for the numerator and denominator of a counting probability, and list the outcomes for small cases to check your reasoning.
Lottery and game odds
Count the possible tickets or hands to see the real odds of a draw.
Password and code spaces
Estimate how many PINs or codes exist for a given length and alphabet.
Scheduling and team selection
Count the ways to choose a committee, assign roles or order presentations.
Tips and limitations
- Ask whether swapping two chosen items gives a different outcome. If yes, use permutations; if no, use combinations.
- nCr is symmetric: choosing 3 of 10 to include is the same as choosing 7 to leave out, so 10C3 = 10C7 = 120.
- Without repetition, r cannot exceed n. With repetition, it can.
- nP0 and nC0 are both 1: there is exactly one way to choose nothing.
- The listing shows up to 200 arrangements. The counts are always exact even when the list is cut short.
Frequently asked questions
What is the difference between a permutation and a combination?
In a permutation the order matters, so A-B-C and C-B-A are different. In a combination order does not matter, so they are the same group. For 3 items chosen from 5 there are 60 permutations but only 10 combinations.
What is the formula for nCr?
nCr = n! / (r! (n - r)!). For 5C3 that is 120 / (6 x 2) = 10.
What is the formula for nPr?
nPr = n! / (n - r)!. For 8P3 that is 8 x 7 x 6 = 336.
How do you calculate combinations with repetition?
Use C(n + r - 1, r). Choosing 2 items from 3 types with repeats allowed gives C(4, 2) = 6: AA, AB, AC, BB, BC, CC.
How many combinations does a 4-digit code have?
If digits can repeat and order matters, 10⁴ = 10,000. If all four digits must be different, 10P4 = 5,040.
Why is 0! equal to 1?
There is exactly one way to arrange zero items: do nothing. Defining 0! = 1 also keeps formulas like nCn = n! / (n! 0!) = 1 consistent.
Is there an in-depth guide to the Permutation and Combination Calculator?
Yes. “Probability Rules, Permutations and Combinations” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.