Home / Math / Permutation and Combination Calculator

Permutation and Combination Calculator (nPr and nCr)

Count ordered arrangements (permutations) and unordered selections (combinations) of r items from n, with or without repetition. Results are exact whole numbers, however large, and all four counts are shown together.

By Adzita Editorial Team · Updated 2026-11-03 · How we build and check our tools

Permutations versus combinations

Both count ways to pick r items from n. The difference is whether order matters. If you are awarding gold, silver and bronze to three of ten runners, the order matters, so you count permutations. If you are choosing a committee of three from ten people, the order does not matter, so you count combinations. Each committee corresponds to 3! = 6 different podium orders, which is why nPr = nCr × r!.

TypeFormulaExample (n=10, r=3)
Permutation nPrn! ÷ (n−r)!720
Combination nCrn! ÷ (r!(n−r)!)120
Permutation with repetitionnr1,000
Combination with repetition(n+r−1)! ÷ (r!(n−1)!)220

When repetition is allowed

Without repetition, each item can be used once, like dealing cards. With repetition, an item can be chosen again, like digits in a PIN. A four-digit PIN is a permutation with repetition of 10 digits taken 4 at a time, giving 104 = 10,000 possibilities. Choosing three scoops of ice cream from five flavours where flavours may repeat and order is irrelevant is a combination with repetition, giving C(7, 3) = 35. The with-repetition combination count uses the "stars and bars" argument, which turns the problem into choosing positions for dividers.

Exact results for large numbers

Factorials grow extremely fast: 20! already exceeds 2 × 1018, which is beyond the safe range of ordinary floating-point numbers. This calculator uses arbitrary-precision integers, and combinations are built up one factor at a time with exact division, so there is no rounding at any step. Short results appear in full with thousands separators. Results longer than 24 digits appear as a leading value, a power of ten and the digit count, such as the 30-digit value of 100C50. The input limit of 1,000 keeps the page responsive.

Common mistakes

Worked example

How many different five-card poker hands can be dealt from a standard 52-card deck?

Inputs

Headline resultCombinations nCr (order does not matter)
Total items n52
Items chosen r5

Result

Combinations nCr = 2,598,960

For n = 52 and r = 5, using n! ÷ (r! × (n − r)!).

Permutations nPr311,875,200
Combinations nCr2,598,960
Permutations with repetition380,204,032
Combinations with repetition3,819,816
Ordered-to-unordered rationPr = nCr × r! (r! = 120)

Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.

Frequently asked questions

What is the difference between nPr and nCr?

nPr counts selections where order matters, while nCr counts selections where it does not. Every combination can be arranged in r factorial orders, so nPr equals nCr times r factorial.

How many ways can you choose 5 cards from 52?

There are 2,598,960 different five-card hands, calculated as 52 choose 5. This ignores the order in which the cards are dealt.

What does 0 factorial equal?

Zero factorial is defined as 1. This keeps formulas such as nC0 and nCn equal to 1, because there is exactly one way to choose nothing and one way to choose everything.

When do I use permutations with repetition?

Use n to the power r when each of r positions can independently take any of n values, as with PIN codes, passwords of a fixed length or dice rolls in sequence.

Is a lottery a permutation or a combination?

It is a combination, because only which numbers are drawn matters, not the order in which the balls come out. A pick-six game from 49 numbers has 13,983,816 combinations.

Probability CalculatorSingle-event odds, two-event and/or rules, and exact binomial probabilities with working.Factorial CalculatorExact n! and n!! up to 1,000, with digit count, trailing zeros and a Stirling check.Fibonacci CalculatorExact nth Fibonacci number, sequence list with golden-ratio convergence, and a Fibonacci checker.Percentage CalculatorPercent of a number, percent change, and increase or decrease by a percent, with working.

References and sources

  1. Standard combinatorics: permutations, combinations and the stars-and-bars method, as presented in discrete mathematics textbooks.

Check primary sources for anything you rely on.