🧰 ToolPicoAll Tools →

Combination & Permutation Calculator

Enter n and r to compute the permutation (nPr, ordered) and combination (nCr, unordered) with a step-by-step factorial breakdown. Includes permutation with repetition, combination with repetition, circular permutation, and exact BigInt results even beyond 170!.

5! = 120 10P3 = 720 10C3 = 120 170!+ → BigInt exact Updated: Jul 19, 2026
#
Total number of elements in the set. Very large numbers are supported.
#
Must satisfy 0 ≤ r ≤ n.
📝 Use my own list — names, words, or prizes instead of A, B, C
Enable custom item listList real combinations/permutations of your own items instead of auto A, B, C labels
Aa
Type a word (letter repeats are counted automatically, e.g. BANANA) or enter group counts separated by commas (e.g. 3,2,1).
#
E.g. fruit varieties, ball colors.
#
More than one of the same type may be chosen.
#
Number of elements seated at a round table, or arranged in a circle/necklace. Round table = (n−1)!, necklace/bracelet = (n−1)!/2.
#
Shows nPr and nCr side by side for r = 0 through n (up to 12 rows) — see the relationship nPr = nCr × r!.
⚙️ Advanced settings — step-by-step, large-number display
Step-by-step solutionShow the factorial expansion
Truncate long numbersShorten results over 40 digits and offer a full copy
List arrangements & selectionsShow the actual combinations and permutations in nPr/nCr mode (≤2,000)
Quick answer A permutation (nPr) counts arrangements where order matters: nPr = n!/(n−r)!. A combination (nCr) counts selections where order doesn't matter: nCr = n!/(r!(n−r)!). For example, choosing an ordered 3-person leadership team from 10 people gives 10P3 = 720 ways, while an unordered 3-person committee from the same 10 people gives 10C3 = 120 ways.
1205! (factorial of 5)
72010P3 (permutation)
12010C3 (combination)
digits in 170!
⚙️ Accuracy note: All results are computed with BigInt, which performs no decimal rounding — so even values beyond 170! (which show "Infinity" on most calculators) are computed exactly, digit for digit. For performance, the total number of elements (n) is capped at 5,000; in permutations with repetition, the total letter/element count is subject to the same cap. All calculations run in your browser — no data is ever sent to a server.

What are combinations and permutations, and how do you calculate them?

A complete guide to the nCr and nPr formulas — the difference between them, their relationship to factorials, and their repeated (with-repetition) versions — with real examples.

Combinations and permutations are the two fundamental combinatorics concepts that count how many different ways you can select a certain number of elements from a set. The only difference between them is whether the order of the selected elements matters. This calculator computes both values at once, shows the factorial expansion step by step, and — even for astronomically large numbers beyond 170! — returns an exact result using BigInt.

What is a permutation (nPr)?

Quick answerA permutation (nPr) is the number of ways to choose and arrange r elements from a set of n, where order matters. Formula: nPr = n! / (n−r)!. For example, how many ways can the top 3 finishers (gold-silver-bronze) be ordered among 5 racers? That's a permutation: 5P3 = 60.

What is a combination (nCr), and how do you calculate it?

Quick answerA combination (nCr) is the number of ways to choose r elements from a set of n, where order doesn't matter. Formula: nCr = n! / (r! × (n−r)!). For example, how many different 3-person project teams can be formed from 10 people (if no one's role matters)? The answer is 10C3 = 120.

What's the difference between a permutation and a combination?

Quick answerThe difference comes down to one word: order. In a permutation, the arrangement/order matters (distinct roles like president-vice president-secretary); in a combination, only the group/selection matters (a committee where no one's role is distinguished). For the same n and r, nPr is always r! times larger than nCr: nPr = nCr × r!. Example: an ordered 3-person leadership team (president/vice-president/secretary) chosen from 10 people can be formed in 10P3 = 720 ways, while an unordered 3-person committee from the same 10 people can be formed in 10C3 = 120 ways — a factor of 720/120 = 6 = 3!.

What is the factorial (n!) formula?

Quick answern! (n factorial) is the product of all positive integers from 1 to n: n! = n×(n−1)×...×2×1, with 0! defined as 1. Both the nPr and nCr formulas are built on factorials. Factorials grow astonishingly fast: 10! = 3,628,800, while 20! already has 19 digits.

What is a permutation with repetition?

Quick answerA permutation with repetition finds the number of distinct orderings of a sequence that contains identical (repeated) elements. If n elements consist of n₁, n₂, ..., nₖ copies of each distinct item, the number of distinct arrangements is n! / (n₁!·n₂!·...·nₖ!). Example: the word "BANANA" (6 letters: 3 A's, 2 N's, 1 B) has 6!/(3!·2!·1!) = 60 distinct arrangements — try your own word in the "Repeated Perm." tab.

What is combination with repetition?

Quick answerCombination with repetition is the number of ways to choose r items from n types, where order doesn't matter and repeats are allowed: C(n+r−1, r). Example: choosing 5 pieces of fruit total from 3 types (apple, pear, banana), where you can take more than one of the same fruit, gives C(3+5−1,5) = C(7,5) = 21 different selections.

What is a circular (round-table) permutation?

Quick answerA circular permutation is the number of ways n elements can be arranged around a circle (a round table). Because rotating the entire arrangement produces the same layout, the linear count n! is divided by n, giving (n−1)!. Example: 6 people can be seated around a round table in (6−1)! = 5! = 120 different ways. For arrangements that can also be reflected — like a necklace or bracelet, where mirror images count as identical — divide by 2 as well: (n−1)!/2; for example, a 6-bead necklace can be arranged in 5!/2 = 60 ways. Try your own n in the "Circular" tab.

Which formula do "how many different ways" questions use?

Quick answerQuestions phrased as "how many different ways can X be selected/formed" are usually combination (nCr) questions, since order is typically irrelevant; "how many different ways can X be arranged/ordered" signals a permutation (nPr). If you're unsure, ask yourself: if two selections contain the same elements but in a different order, do they count as "different"? If yes, use nPr; if no, use nCr.

Consider a classic example: how many ways can a 3-person team be formed from 10 people? If there are no distinct roles (everyone is an equal member), this is a combination: 10C3 = 120. But if the team has a captain, a vice-captain, and a designated goalkeeper (distinct roles), it's a permutation: 10P3 = 720. Enter n=10, r=3 in the calculator above to see both results at once, with the step-by-step breakdown.

Popular nPr / nCr values

Quick access to the most commonly searched n and r combinations — click one to auto-fill the calculator.

Related mini calculators

Common everyday uses of combinatorics: password possibilities, lottery odds, Pascal's triangle, and hypergeometric probability. All work instantly.

🔐Password / PIN combinations
How many distinct sequences of length r can be formed from an alphabet of n symbols, allowing repeats?
🎟️Lottery / raffle odds
In a lottery/raffle where r numbers are drawn from n, what are the odds your unordered set of r numbers matches?
🔺Pascal's triangle row
Lists every C(n,k) value (k=0..n) in a given row of Pascal's triangle at once.
🎯Probability calculator (hypergeometric)
A set of n items has K "successes" in it. If you draw r items at random (no replacement), what's the probability exactly k of them are successes?

Combinatorics reference tables

Citable ready-made tables: common nPr/nCr pairs, a factorial table, Pascal's triangle, and a formula comparison.

nPr and nCr values for the most commonly searched n, r pairs
n, rnPrnCr
4, 2126
5, 22010
5, 36010
6, 23015
6, 312020
7, 321035
8, 333656
9, 350484
10, 3720120
10, 45,040210
12, 595,040792
20, 51,860,48015,504

Values verified against this tool's BigInt calculation engine.

Factorial table, 0! through 15!
nn!
0!1
1!1
2!2
3!6
4!24
5!120
6!720
7!5,040
8!40,320
9!362,880
10!3,628,800
11!39,916,800
12!479,001,600
13!6,227,020,800
14!87,178,291,200
15!1,307,674,368,000

For larger factorials, increase n in the "nPr / nCr" tab above — BigInt computes exact results with no practical upper limit (n ≤ 5,000).

Pascal's triangle — rows 0 through 10 (each value is a C(n,k))
Row (n)Values C(n,0..n)
01
11, 1
21, 2, 1
31, 3, 3, 1
41, 4, 6, 4, 1
51, 5, 10, 10, 5, 1
61, 6, 15, 20, 15, 6, 1
71, 7, 21, 35, 35, 21, 7, 1
81, 8, 28, 56, 70, 56, 28, 8, 1
91, 9, 36, 84, 126, 126, 84, 36, 9, 1
101, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1

The k-th value in row n equals C(n,k). Use the "Pascal's triangle row" mini tool above to generate rows up to 100.

nPr and nCr formula comparison
ConceptFormulaOrder matters?
Permutation (nPr)n! / (n−r)!Yes
Combination (nCr)n! / (r!(n−r)!)No
Permutation with repetitionn! / (n₁!n₂!...nₖ!)Yes (except within groups)
Combination with repetitionC(n+r−1, r)No
Circular (round table)(n−1)!Yes (except rotation)
Necklace / bracelet(n−1)!/2Yes (except rotation+reflection)
Arrangement with repetition (n^r)Yes

Relationship: nPr = nCr × r!. nCr is always 1 when r=0 or r=n.

Add this calculator to your site (embed code)

Embed the combination & permutation calculator on your own website for free. Copy the code below into your HTML — the tool runs in a simplified view and links back to this page as its source.

The embedded tool has a fixed layout; you can adjust the height value to fit your site. No ads or personal data, runs entirely client-side.

Combinatorics terms glossary

Short definitions of the core terms used in nCr/nPr calculations.

Permutation (nPr)The number of ways to choose and arrange r elements from a set of n, where order matters.
Combination (nCr)The number of ways to choose r elements from a set of n, where order doesn't matter.
Factorial (n!)The product of all positive integers from 1 to n. 0! = 1.
Permutation with repetitionThe number of distinct orderings of a sequence containing identical elements: n!/(n₁!n₂!...).
Combination with repetitionThe number of unordered selections made with repeats allowed: C(n+r−1, r).
Circular permutationArrangement around a circle (round table); rotations count as identical: (n−1)!. For a necklace/bracelet, reflections count as identical too: (n−1)!/2.
BigIntA JavaScript data type that stores arbitrarily large integers exactly, with no rounding.
Pascal's triangleA triangular array whose n-th row lists every combination C(n,0) through C(n,n).
Sample spaceThe set of all possible outcomes of an experiment; forms the denominator in probability calculations.
Ordered selectionA selection where the order of the chosen elements changes the outcome (permutation).
Unordered selectionA selection where only the group of chosen elements matters, not their order (combination).

In-depth guides

Detailed answers to the most commonly asked combination/permutation questions.

How many different ways can a 3-person team be formed from 10 people?

If there's no distinction of role among the 3 team members (everyone is an equal member), this is a combination question: 10C3 = 120. But if the team has a captain, a vice-captain, and a reserve (distinct roles), it's a permutation question: 10P3 = 720. The difference is exactly 3! = 6 times, because the same 3-person group can be arranged into roles in 6 different ways.

Enter n=10, r=3 into the calculator above and view both results at once in the "nPr / nCr" tab, with the step-by-step breakdown.

How many ways can the letters of "BANANA" be arranged?

BANANA has 6 letters, but they aren't all different: 3 A's, 2 N's, and 1 B. If every letter were distinct, there would be 6! = 720 arrangements — but since identical letters swapping places produces the same-looking word, that overcount is corrected by dividing by the factorials of the repeated groups: 6! / (3!·2!·1!) = 720 / 12 = 60.

This is called a "permutation with repetition," and it's used in word games, anagram analysis, password entropy, and more. Try typing any word into the "Repeated Perm." tab.

What are the odds of matching all 6 numbers in a 6/49 lottery?

Choosing 6 numbers unordered out of 49 gives a total of 49C6 = 13,983,816 possible combinations. Since your chosen 6 numbers are just one of those, the odds of matching all of them are 1 in 13,983,816 (about 0.0000072%).

This is a combination calculation because the order the numbers are drawn in doesn't matter — however they come out, the same 6 numbers are the same result. Try different n/r values with the "Lottery / raffle odds" mini tool above.

Frequently asked questions

What is nCr and how do you calculate it?
nCr (combination) is the number of ways to choose r elements from a set of n, where order doesn't matter. Formula: C(n,r) = n! / (r!·(n−r)!). For example, a 3-person team from 10 people (where it doesn't matter who is "president" vs. "member") can be formed in 10C3 = 120 different ways.
What is the difference between permutation and combination?
In a permutation (nPr), the order of elements matters (an arrangement); in a combination (nCr), order doesn't matter (a selection/group). For the same n and r, nPr is always r! times larger than nCr: nPr = nCr × r!. Example: choosing 2 of 3 people in order (president, then vice-president) gives 3P2 = 6 ways, while choosing an unordered group of 2 gives 3C2 = 3 ways.
What is the factorial (n!) formula?
n! (n factorial) is the product of all positive integers from 1 to n: n! = n×(n−1)×(n−2)×...×2×1. By convention, 0! = 1. Example: 5! = 5×4×3×2×1 = 120. Factorials grow extremely fast — values above 170! exceed the range of JavaScript's standard Number type, so this tool switches to BigInt at that point for exact results.
What is a permutation with repetition?
A permutation with repetition counts the distinct orderings of a sequence that contains identical elements. If n elements consist of n1, n2, ..., nk copies of each distinct item, the number of distinct arrangements is n1! · n2! · ... · nk! dividing into n!. Example: the word "BANANA" (6 letters: 3 A's, 2 N's, 1 B) has 6!/(3!·2!·1!) = 60 distinct arrangements.
How many different ways can something be selected? (using nCr in practice)
"How many different ways can X be selected/formed" questions are usually combination (nCr) questions, since order typically doesn't matter. The number of ways to choose r elements from n is C(n,r) = n!/(r!(n−r)!). For example, the number of ways to form a 3-person committee from 10 people is 10C3 = 120.
What is the combination formula?
The combination formula is C(n,r) = n! / (r! × (n−r)!), and it gives the number of unordered ways to choose r elements from a set of n. The formula requires 0 ≤ r ≤ n; when r=0 or r=n, the result is always 1.
What is combination with repetition, and how do you calculate it?
Combination with repetition is the number of unordered ways to choose r items from n types, allowing repeats. Formula: C(n+r−1, r). Example: choosing 5 pieces of fruit total from 3 types (apple, pear, banana), where more than one of the same type is allowed, gives C(3+5−1,5) = C(7,5) = 21 different selections.
Why do factorials above 170 show "Infinity" on a normal calculator?
JavaScript and most calculators use floating-point (double-precision) numbers, whose upper limit is about 1.79×10³⁰⁸. 171! exceeds that limit, so the result displays as "Infinity". This tool uses the BigInt data type, which preserves full integer precision, to compute even factorials with thousands of digits exactly.
What is a circular (round-table) permutation, and how do you calculate it?
A circular permutation is the number of ways n elements can be arranged around a circle (a round table). Since rotating the whole arrangement produces the same layout, the linear count n! is divided by n, giving (n−1)!. Example: 6 people can be seated around a round table in (6−1)! = 5! = 120 different ways. For arrangements that can also be flipped over — like a necklace or bracelet, where mirror images count as identical — divide by 2 as well: (n−1)!/2. Example: a 6-bead necklace has 5!/2 = 60 distinct arrangements.
Can I see the actual list of combinations and permutations?
Yes. In the "nPr / nCr" tab, after entering n and r, the result card shows expandable lists of the actual C(n,r) combination selections ({A,B}, {A,C}…) and P(n,r) permutation arrangements ((A,B), (B,A)…). Items are automatically labeled A, B, C… (or 1, 2, 3… if n>26). For browser performance, each list is capped at 2,000 rows; larger results show only the total count.
Can I use my own names or items instead of A, B, C?
Yes. In the "nPr / nCr" tab, open "Use my own list" and paste your own items — names, words, prizes, team members — separated by commas or line breaks. The item count sets n automatically, and the combination/permutation lists are generated from your actual items instead of auto-labeled A, B, C. Once generated, you can copy the list as text or download it as a .txt file using the buttons next to the list.

Methodology & sources

ToolPico's Combination & Permutation Calculator is a free, independent tool. All calculations follow classical combinatorics definitions and are computed with JavaScript's BigInt data type: no decimal rounding occurs, so even values beyond 170! are computed exactly, digit for digit.

Formulas: nPr = n!/(n−r)! · nCr = n!/(r!(n−r)!) · Permutation with repetition = n!/(n₁!n₂!...) · Combination with repetition = C(n+r−1,r) · Circular permutation = (n−1)! · Necklace/bracelet = (n−1)!/2. Basis: Standard combinatorics (discrete mathematics). Last updated: July 19, 2026. All calculations run in your browser; no data is sent to a server. Results are for informational and educational purposes only.
Explore all ToolPico tools →

🔗 Add this tool to your site

Copy the code below into your own site. The tool is free, always up to date, and runs entirely on your page. No sign-up required.

Preview →
⚡ Built with ToolPico · toolpico.com