Permutation & Combination Calculator
Count selections and arrangements exactly, choose whether repetition is allowed, and export large integer results without rounding.
This tool processes its input contents in your browser instead of sending them to a processing service. Page, asset and fixed usage-measurement requests are described on the Privacy page.
Count selections and arrangements exactly, choose whether repetition is allowed, and export large integer results without rounding.
How to use it
- 1Choose combinations for unordered selections or permutations for ordered arrangements.
- 2Enter available types n and selected positions r.
- 3Choose whether a type may repeat, then calculate.
- 4Download the exact count as a decimal string.
Example
- Input
- Combinations; n = 52; r = 5; repetition off
- Output
- 2,598,960 distinct selections.
Order is ignored and each available card can be used once. This is a count of selections, not the probability of a particular poker event.
What happens to your data
The selected counts and repetition setting are evaluated locally with BigInt. Exact decimal counts are written into a local download; no remote counting service or saved calculation history is required.
Last updated November 2026
Count selections and ordered arrangements without rounding large integers. Choose combinations when order does not matter, or permutations when it does. The repetition control makes a second assumption explicit: whether the same item type may be chosen again. Results are exact integers within a bounded calculation budget and export as JSON strings so long counts retain every digit.
How it works
Enter n, the number of distinct available items or item types, and r, the number of selected positions. Without repetition, combinations count unordered selections using C(n,r); permutations count ordered selections using n!/(n−r)!. If r exceeds n, there is no valid selection without repetition and the result is zero. An empty selection has one arrangement, including n = 0 and r = 0.
With repetition enabled, ordered selections use n^r: each position can choose from the same n types. Unordered selections use C(n+r−1,r) when n is positive, counting how many of each type is taken. With no available types, selecting a positive number of items still has zero possibilities. This mode does not count permutations of a particular supplied multiset with fixed repeated-item quantities; it counts reuse of available types under the selected assumptions.
The implementation uses exact BigInt integer arithmetic. Combinations are built incrementally with exact divisions rather than constructing huge factorials first. Permutations without repetition multiply only the required descending factors; repeated ordered choices use bounded exponentiation. The exported count is deliberately a string, because a normal JSON number could round a long integer in another program. The digits field records its decimal length.
Both n and r must be whole counts from zero to 10,000. The exact output has a 5,000-bit size limit, and combinations take at most 10,000 iterations. A large input can therefore be within the count range yet still exceed the output budget; the result then fails clearly without a partial or approximate count. Each field is at most 16 KiB, and complete result and working files are at most 32 KiB each.
The calculator counts possibilities under the stated rules. It does not assign probabilities, guarantee that outcomes are equally likely, enforce real-world inventory or discover extra restrictions in a word problem. A useful first check is to ask whether swapping two chosen items creates a different result; if it does, choose permutations. Then decide separately whether an item may appear more than once.
Worked example: Choose a five-card hand
- Input
- Combinations; n = 52; r = 5; repetition off
- Result
- 2,598,960 distinct selections.
Order is ignored and each available card can be used once. This is a count of selections, not the probability of a particular poker event.
Common use cases
- Count a committee chosen from distinct available people.
- Compare ordered prize positions with unordered selections.
- Count fixed-length choices when repeated types are allowed.
- Export a large exact result for further calculation without numeric rounding.
Frequently asked questions
What is the difference between nPr and nCr?+
nPr counts ordered selections, so choosing A then B differs from B then A. nCr counts unordered selections, so those two orders describe the same selection.
What does repetition mean here?+
It allows any of the n item types to be selected repeatedly. It is a separate choice from whether order matters. It does not mean that a fixed list of duplicated objects was supplied.
Why is a large result quoted in the JSON file?+
The count is stored as a decimal string so another JSON reader cannot round it to a floating-point number. All of its digits remain present.
Why can a count below 10,000 still exceed a limit?+
The input bounds limit n and r; the separate 5,000-bit bound limits the size of the result. Some combinations grow too large even when both inputs are individually allowed.
Related tools
Business Day Calculator
Count or offset working dates using chosen weekdays and your own excluded dates, then export the exact date schedule and assumptions.
Ohm’s Law Calculator
Find positive DC voltage, current, resistance and power from two known quantities, with unit prefixes, equations and CSV output.
Triangle Solver
Solve a triangle from three known measurements, with all sides, angles, area, altitudes and a downloadable diagram.
Random Team Generator
Split up to 200 participants into random teams with balanced sizes and local TXT, CSV and JSON downloads.