Permutation & Combination Calculator
Calculate nPr (permutations) and nCr (combinations) with step-by-step factorial expansion. Supports n and r up to 20.
Did this tool work for you?
How to use this calculator
Permutations count ordered arrangements; combinations count unordered selections. nCr = nPr / r! because each combination corresponds to r! permutations.
- 1
Enter n — the total number of items available.
- 2
Enter r — the number of items to choose.
- 3
Both nPr (ordered arrangements) and nCr (unordered selections) are calculated with factorial steps shown.
- 4
n must be at most 20 to avoid integer overflow.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts ordered arrangements and nCr counts unordered selections of r items from n different ones. P(10,3) = 720 because ABC and CBA are different orders; C(10,3) = 120 because they are one group. Each group of r items can be ordered in r! ways, so nPr = nCr × r!, which is what the last result row shows.
Why does the calculator stop at n = 20?
The calculation uses ordinary floating-point numbers, and factorials grow quickly. 20! = 2,432,902,008,176,640,000 is the largest the tool displays; above 20 it returns “n must be ≤ 20 (to avoid overflow)”. Real-world cases like a 52-card deck or a 6-from-49 lottery are therefore out of range here.
What happens when r equals 0 or equals n?
Both are valid. Choosing zero items has exactly one outcome, so P(5,0) = 1 and C(5,0) = 1, using 0! = 1. Choosing all n items gives C(n,n) = 1 and P(n,n) = n!, for example P(8,8) = 40,320 and C(8,8) = 1.
What inputs produce an error?
Negative numbers (“n and r must be non-negative”), r greater than n (“r cannot exceed n”), n above 20, and non-integers such as 5.5 (“n and r must be whole numbers”). Blank fields are read as 0.
Does it handle repeated items or repetition allowed?
No. It assumes every item is distinct and each is used at most once. Arrangements with repetition (n^r), multiset permutations with identical items and combinations with repetition need different formulas.
Why do the results have commas?
Numbers are formatted with the browser’s locale, so separators may show as periods or spaces instead of commas on devices set to other regions. The underlying values are the same.
Are nCr values symmetric?
Yes, C(n, r) = C(n, n − r). Choosing which 3 of 10 to include is the same as choosing which 7 to leave out: C(10,3) = C(10,7) = 120. The permutations differ though: P(10,3) = 720 but P(10,7) = 604,800.
Does it show the working?
Yes. It lists the factorials n!, r! and (n−r)!, the substituted formula for each of nPr and nCr, and the ratio nPr ÷ nCr. It does not simplify the fractions step by step or show a cancelled form.
Permutation and combination calculator — nPr and nCr
Order matters, or it does not
Permutations are arrangements where order counts: nPr = n! ÷ (n − r)!. Combinations are selections where order is irrelevant: nCr = n! ÷ (r!(n − r)!). Awarding gold, silver and bronze to three of ten runners is a permutation; picking a three-person committee from ten people is a combination. The calculator returns both for the same n and r, with the factorials written out.
Worked examples
For each pair of n and r, P(n,r) counts ordered selections and C(n,r) counts unordered ones, so permutations are always r! times larger than the matching combination. These pairs were run through the calculator to give the exact figures.
| n, r | nPr | nCr | Ratio nPr ÷ nCr |
|---|---|---|---|
| 10, 3 | 720 | 120 | 6 |
| 10, 4 | 5,040 | 210 | 24 |
| 15, 3 | 2,730 | 455 | 6 |
| 10, 7 | 604,800 | 120 | 5,040 |
| 20, 10 | 670,442,572,800 | 184,756 | 3,628,800 |
| 8, 8 | 40,320 | 1 | 40,320 |
Podiums and committees
With 10 runners, the number of ways to fill first, second and third place is P(10,3) = 720. Ignoring order and simply choosing three finalists gives C(10,3) = 120, and 720 ÷ 120 = 6 is exactly 3!, the number of ways to order any chosen trio. In the same way, picking 4 from 10 gives 210 groups but 5,040 ordered lineups, a ratio of 4! = 24.
Symmetry and the edges of the range
Since C(n, r) = C(n, n − r), the 10, 7 row shows the same combination count as 10, 3 (120) while its permutation count is 604,800. At the top end, 20 items arranged in full give P(20,20) = 2,432,902,008,176,640,000, which is the biggest figure the tool accepts. The smallest edge is r = 0, where both counts are 1.
Where the tool stops
Whole numbers only, n at most 20, r no larger than n, and every item must be distinct. There is no repetition mode and no probability conversion; divide a favourable count by the total count yourself. Use big-number software for larger n, such as a standard deck of 52 cards or a 49-ball lottery draw. When n is small enough to enumerate, you can sanity-check a result by listing the outcomes by hand, for instance all arrangements of three letters. Always confirm whether your problem treats order as meaningful before reading either column, since picking the wrong one is the most common mistake in counting problems.
Learn more from an authoritative source:
WikipediaFraction / Decimal / Percent Converter
Convert between fractions, decimals, and percentages in any direction. Six conversion modes in one tool.
Decimal to Fraction Calculator
Convert any decimal number to a simplified fraction in lowest terms, with step-by-step working. Handles terminating and long decimals.
Simplify Fractions Calculator
Reduce any fraction to its simplest form (lowest terms) using the GCD. Shows the GCD used and the decimal equivalent.
Compare & Order Fractions
Compare and order up to four fractions from smallest to largest, showing decimal equivalents and the LCD. Leave unused fields at 0.
Equivalent Fractions Calculator
Generate a list of equivalent fractions for any given fraction. Shows the simplified form and up to 10 equivalents.
LCD — Least Common Denominator
Find the Least Common Denominator (LCD) of up to four denominators, with prime factorization method shown step-by-step.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →