Permutation and Combination Calculator - nPr and nCr
Exact permutations and combinations, with and without repetition. Default n = 10, r = 3 gives P = 720 and C = 120.
n and r
n and r are non-negative integers with n ≥ r. Combinations require n ≤ 500. Results over 8000 digits are rejected.
CountsCalculated
Order Matters: Permutations versus Combinations
A permutation and combination calculator answers counting questions that look similar until you ask whether order is part of the outcome. Lined-up finishes, PINs that cannot reuse a digit, and seating charts are permutations: ABC is not ACB. Lottery tickets, unordered committees, and handfuls of cards are combinations: the same three people are one committee no matter who was nominated first.
The compact formulas are nPr = n! / (n − r)! and nCr = n! / (r! (n − r)!). This page evaluates them with BigInt and a multiplicative loop, so 10 P 3 is exactly 720 and 10 C 3 is exactly 120 - the default inputs. Combinations are capped at n ≤ 500. Any integer longer than 8000 digits is refused rather than truncated.
Counting runs entirely in the browser. For probabilities that use these counts as a denominator, continue with the probability calculator. Factorials are related to prime factorization of n!; see the factor calculator if you need the factors of n itself rather than nPr.
How to Count nPr and nCr Here
- Enter non-negative integers n and r with n ≥ r for counting without replacement.
- Read nPr (ordered, no reuse) and nCr (unordered, no reuse).
- Also read nr (ordered, reuse allowed) and C(n+r−1, r) when that binomial is not enormous.
- Copy the exact integers, or clear both fields. Huge results preview with an ellipsis in the panel; Copy still has the full decimal string up to the 8000-digit cap.
0 P 0 = 1 and 0 C 0 = 1 by the empty-product convention. r = 0 always gives 1 permutation and 1 combination without replacement.
Formulas, Including the 10 Choose 3 Check
Expanding the permutation: n × (n−1) × … × (n−r+1). For n = 10 and r = 3 that is 10 × 9 × 8 = 720. Each unordered trio corresponds to r! = 6 ordered triples, so C(10, 3) = 720 / 6 = 120. Written as a binomial, 10! / (3! × 7!) is the same 120.
The multiplicative algorithm never builds n! when r is small: it multiplies n − r + i and divides by i at step i, which stays integral. That is why n = 500 is feasible in a browser tab while a naive 500! string would be a slog to reduce afterward.
With repetition
- Permutations with replacement: each of r slots has n labels, so nr. For 10 and 3 that is 1000.
- Combinations with replacement (multisets): C(n + r − 1, r). For 10 and 3 that is C(12, 3) = 220.
When Order Matters - and When It Does Not
Read the problem for verbs. “Arrange,” “line up,” “first, second, third,” and “distinct codes” almost always want permutations. “Select,” “choose,” “committee,” and “hand of cards” almost always want combinations. If two sequences of the same items would be scored as different outcomes, order matters.
Reuse is a second axis. A four-digit PIN that allows repeated digits is 104, not 10 P 4. Ice-cream scoops where flavor repeats but order in the bowl does not is a multiset, C(n+r−1, r). Mixing those four formulas is the usual source of off-by-a-factor-of-r! mistakes.
| Reuse? | Order matters | Order ignored |
|---|---|---|
| No | nPr | nCr |
| Yes | n^r | C(n+r−1, r) |
Worked Counting Stories
Race medals for 10 runners, 3 podiums
Gold/silver/bronze are ordered and nobody gets two medals: 10 P 3 = 720.
A 3-person committee from 10 students
The committee is a set: 10 C 3 = 120. If the committee later elects a chair, that is 120 × 3 = 360, which is also 10 P 3 / 2! if you assigned chair last among the three - different story, different formula.
Lock digits that may repeat
Three digits, 0–9, repetition allowed: 103 = 1000. If digits must be distinct, drop to 720.
Multiset of three scoops, 10 flavors
Order in the cup ignored, repeats allowed: C(12, 3) = 220.
Limits: n ≤ 500, 8000 Digits, Browser Arithmetic
Combinations use the multiplicative formula with n at most 500 so a tab cannot freeze on a pathological binomial. nPr can still grow fast: 500 P 80 is already a mountain of digits. Anything past 8000 decimal digits errors out. Copy would be useless as a pasted wall of text beyond that anyway.
C(n+r−1, r) is skipped when n+r−1 is huge, with a note rather than a wrong truncated integer. n^r is estimated in log10 space before the power loop so 500^4000 cannot melt the page.
For general powers that are not counting problems, use the scientific calculator. This page is for integer nPr / nCr, not floating-point n^r with a decimal r. It also will not enumerate the 720 permutations as lists of symbols - only the count. If you need the actual listings, a CAS or a short program is the right tool; 500 P 5 is already 3.06×10¹³ rows, which no webpage should print.
Identities You Can Use to Check the Output
nCr = nPr / r! whenever r ≤ n. 720 / 6 = 120 is the 10-and-3 check. Pascal’s identity C(n, r) = C(n−1, r) + C(n−1, r−1) is the triangle recurrence: C(10, 3) = C(9, 3) + C(9, 2) = 84 + 36 = 120. Symmetry C(n, r) = C(n, n−r) is why the multiplicative loop can swap r for n−r when that is smaller. Hockey-stick and Vandermonde sums are true but not needed to read this page.
n^r counts functions from an r-set to an n-set. nPr counts the injective ones. nCr counts r-subsets. C(n+r−1, r) counts non-negative integer solutions to x₁ + … + xₙ = r (stars and bars with n bins). Those four sentences are the whole dictionary this calculator implements. It does not count derangements, necklaces, or partitions.
Circular Permutations and Indistinguishable Items
Seating n distinct people around a unlabeled round table is (n−1)!, not n!, because rotations of the same circle are the same seating. If reflections also count as identical (a necklace you can flip), you are into Burnside and this tool will not help. If the seats are numbered, you are back to n! ordinary permutations (r = n, so nPn = n!).
Repeated letters shrink the count: MISSISSIPPI has 11 letters with frequencies 1,4,4,2, so the distinct rearrangements are 11! / (4! 4! 2!), not 11 P 11. This calculator assumes all n items are distinct. If your problem has identical objects, divide the nPr or n! result by the factorial of each repeated group yourself - the page will not detect the word “identical” in a story problem.
With replacement, n^r still assumes the n labels are distinct types (ten digits, 26 letters). Combinations with repetition assume you only care how many of each type you took, not the order you scooped them. Ice cream with “two chocolate and one vanilla” is one multiset; “vanilla then chocolate then chocolate” as a layered sundae might be a permutation with repetition instead.
Probability Connections without Doing the Probability
A fair lottery that draws r distinct numbers from n and ignores order has 1 / C(n, r) as the chance of one specific ticket. A race on n horses paying the trifecta in order has 1 / nPr for one exact podium if every permutation is equally likely - which real odds never are. A PIN of r digits with repetition allowed has 1 / n^r if every string is equally likely. This page stops at the denominator. Attach a numerator on the probability tool if you need P(event).
Hypergeometric problems (“5 defectives in a lot of 40, draw 8”) are ratios of combinations: C(K, k) C(N−K, n−k) / C(N, n). You can compute each binomial here and divide by hand. Binomial coefficients this large stay exact until the 8000-digit wall; dividing two of them in floating point is a separate rounding story.
Choosing r, Empty Products, and Why 0! Is 1
The empty product is 1, so 0! = 1, nP0 = 1, and nC0 = 1: there is one way to choose nothing and one way to arrange nothing. nPn = n! because you used every item. nCn = 1 because there is one full set. Those identities are why the default formulas still make sense at the edges instead of dividing by zero.
If a problem says “at least 3 of 10,” that is a sum C(10,3) + … + C(10,10), not a single nCr. This calculator returns one r at a time. Add the rows yourself, or notice that “at least 3” = 2^10 − C(10,0) − C(10,1) − C(10,2) when every subset is allowed. Powers of two are subset counts, which are not nPr.
Large r with modest n is cheap because of symmetry: C(500, 498) equals C(500, 2) = 124750, and the loop only runs two steps. nP498 of 500 still multiplies 498 terms and can hit the digit cap even when the combination is tiny. If Copy fails because nPr exploded, drop r or switch to nCr.
Frequently Asked Questions (FAQ) - Permutations and Combinations
What is the difference between a permutation and a combination?
A permutation counts ordered arrangements: ABC and ACB are different. A combination counts unordered selections: {A, B, C} is one set no matter the order. Use nPr when order matters (race finishes, PINs with distinct digits). Use nCr when order does not (lottery tickets, committee seats that are identical).
What is the nPr formula?
nPr = n! / (n−r)! = n × (n−1) × … × (n−r+1). It is the number of injective functions from a set of size r into a set of size n, or the number of ways to fill r ordered slots from n distinct items without reuse. For n = 10 and r = 3, 10 × 9 × 8 = 720.
What is 10 choose 3 (nCr)?
10 choose 3 is C(10, 3) = 10! / (3! × 7!) = 120. The same count is nPr / r! because each unordered trio corresponds to 3! = 6 ordered triples. This calculator’s default inputs are n = 10 and r = 3 so you can see 720 permutations and 120 combinations immediately.
What is the difference between counting with and without repetition?
Without repetition you cannot reuse an item: nPr and nCr. With repetition, permutations are n^r (each of r positions may be any of n labels). Combinations with repetition - “stars and bars” - are C(n+r−1, r), the number of multisets of size r from n types.
When does order matter in counting problems?
Order matters when two arrangements of the same items would be treated as different outcomes: passwords, batting orders, seating around a labeled row. Order does not matter when the outcome is only the set of items: a handful of cards, a bag of fruit, a subset of students. If the problem says “arranged” or “first, second, third,” start with permutations.
Does this permutation calculator send n and r to a server?
No. Factorials and binomial coefficients are computed locally with BigInt. Nothing is uploaded. After the page loads, you can still count offline. The last n and r are stored only in this browser’s localStorage for up to 30 days.
When 720 Is a Count, Not a List
Classroom worksheets sometimes ask students to list all permutations of three letters from A, B, C, and D. That list has 4 P 3 = 24 lines, which is doable. The default 10 P 3 = 720 is already a miserable list; 10 C 3 = 120 is a long but finite catalog of triples. This calculator is the count, so you can know when listing is hopeless before you start. If an assignment required the list, it almost certainly used tiny n and r.
Complementary counting is the other reason to want an exact integer: “how many 10-letter strings from 26 letters have no restriction” is 26^10, which this page will compute as n^r with n = 26 and r = 10, then you subtract the forbidden patterns elsewhere. Exact integers matter once you subtract two huge counts; a scientific-notation 1.41e14 would lose the low digits.
Why Use This nPr / nCr Calculator?
- Exact BigInt results, not a rounded 1.23e45 for modest n.
- Four counts at once: nPr, nCr, n^r, and stars-and-bars.
- Default 10, 3 → 720 and 120 so you can verify the page immediately.
- Hard cap at 8000 digits instead of locking the tab.
- Private in-browser counting with Copy and Clear.
Related Tools
Discover more free developer tools that might interest you.
Area Calculator
Calculate area of squares, rectangles, triangles, circles, and more
Use ToolAverage Calculator
Calculate mean, median, mode, and range from a list of numbers
Use ToolBasic Calculator
Add, subtract, multiply, and divide with a free online calculator
Use ToolBig Number Calculator
Add, subtract, multiply, and divide integers too large for a standard calculator
Use ToolBinary Calculator
Add, subtract, and convert binary numbers to decimal and hex
Use ToolCircle Calculator
Find radius, diameter, circumference, area, arc length, and sector area
Use ToolRelated guides
Read the how-to, then come back to this tool when you are ready to run it locally.