Math

Permutations & Combinations Calculator

Choose r items from n and see how many ways you can do it — ordered (permutations) or unordered (combinations), with and without repetition — plus the factorial working and Pascal’s triangle.

Calculator

Combinations nCr
10
Choosing 3 from 5.
Permutations nPr (ordered)
60
Permutations with repetition (nʳ)
125
Combinations with repetition
35

Working

nPr = n! / (n − r)! = 5! / 2! = 60

nCr = n! / (r!·(n − r)!) = 10

Pascal’s triangle (row n = 5)

Permutations vs combinations

A permutation counts arrangements where order matters: nPr = n!/(n − r)!. A combination counts selections where order does not matter, so it divides out the r! orderings of each group: nCr = n!/(r!·(n − r)!). nCr is therefore always nPr divided by r!.

When items can be picked more than once, permutations with repetition are simply nʳ, and combinations with repetition are C(n + r − 1, r). The nCr values are exactly the numbers in Pascal’s triangle: row n, position r.

When should I use a permutation vs a combination?

Use a permutation when the order of the chosen items matters — a race podium, a PIN, a ranked list. Use a combination when only the group matters, not its order — a lottery draw, a committee, a hand of cards.

What does ‘with repetition’ mean?

With repetition, the same item can be selected more than once — like a 4-digit code where digits can repeat. Without repetition each item is used at most once, like dealing distinct cards.

How is this related to Pascal’s triangle?

Every entry in Pascal’s triangle is a combination: the value in row n, position r is exactly nCr. Each number is the sum of the two above it, which mirrors the identity nCr = (n−1)C(r−1) + (n−1)Cr.

Results are estimates. Verify with a professional for important decisions.

About this calculator

This calculator finds all four classical counting values at once: ordered selections without repetition (nPr), unordered selections without repetition (nCr), ordered selections with repetition (nʳ), and unordered selections with repetition. Enter the pool size n and the sample size r, and see every count instantly.

How to read your results

The headline figure is nCr — the number of ways to choose r items from n when order does not matter. Below it you also get nPr (order matters, no repeats), nʳ (order matters, repeats allowed), and the with-repetition combination count. The step-by-step breakdown shows the factorial expansion for nPr and nCr, and the Pascal's-triangle panel highlights exactly where your nCr value sits.

Worked example

Choose 3 items from a pool of 5 (for example, selecting 3 toppings from a menu of 5).

nPr = 60 ordered arrangements; nCr = 10 unordered selections; with repetition: 125 ordered and 35 unordered.

Frequently asked questions

What is the difference between a permutation and a combination?

A permutation counts arrangements where the order matters — ABC and BAC are two different outcomes. A combination counts selections where the order does not matter — ABC and BAC are the same outcome. In practice, use permutations for rankings, orderings, or sequences, and combinations for committees, teams, or subsets.

When should I use the "with repetition" variants?

Use with-repetition counts when items can be chosen more than once — for example, picking digits for a password or selecting flavours when the same flavour can appear multiple times. The formula nʳ covers ordered choices with repeats; C(n+r−1, r) covers unordered choices with repeats.

Why does the calculator cap n at 170?

170 is the largest integer whose factorial fits in a 64-bit floating-point number (170! ≈ 7.3 × 10³⁰⁶). Beyond that, JavaScript's Number type overflows to Infinity. The calculator uses the multiplicative formula rather than computing full factorials, so results are accurate up to the JavaScript safe-integer limit.

How it's calculated

Permutations without repetition use nPr = n! / (n − r)!, computed multiplicatively as the product n × (n−1) × … × (n−r+1) to avoid overflow. Combinations without repetition use nCr = n! / (r!(n−r)!), computed with the symmetric multiplicative formula ∏(n−k+i)/i for i = 1..k where k = min(r, n−r). Ordered with repetition is simply nʳ. Unordered with repetition applies the multiset formula C(n+r−1, r), also computed multiplicatively.

Spot a translation issue, a calculation issue, or have a suggestion? Let us know.

200 more like this. Pick the next one.