Skip to content
Allin

Permutation calculator (nPr)

Compute the number of permutations nPr of r items from n.

Combination calculator (nCr)Compute the number of combinations nCr of r items from n.Derangement (subfactorial) calculator !nCompute the subfactorial !n — the number of derangements, permutations of n items in which nothing stays in its original place. It uses the exact recurrence !n = (n−1)·(!(n−1) + !(n−2)) with big integers, and shows the ratio !n / n!, which converges astonishingly fast to 1/e ≈ 0.3679. That ratio is the probability that a random shuffle leaves no element fixed — the classic 'hat-check' problem.Factorial calculatorCompute the factorial n! of a whole number.Inclusion–exclusion principle calculatorCompute the size of a union of 2 to 5 sets by inclusion–exclusion: add the individual sizes, subtract the pairwise overlaps, add back the triple overlaps, and so on, alternating signs. Work directly from your element lists — the tool sorts every element into its region and cross-checks the count — or from raw cardinalities like |A|, |A∩B|, |A∩B∩C| when you only know the counts. It shows each level's contribution and the final |A ∪ B ∪ …|.Permutations with repetition calculatorCount the ordered arrangements of length r drawn from n items when repetition is allowed — every position can be any of the n choices independently, giving exactly nʳ. This is the arrangement count for PIN codes, passwords, DNA strings and dice rolls, and it differs from ordinary permutations nPr, which forbid reuse. The result is computed exactly with big integers, however large it grows.Pigeonhole principle calculatorApply the pigeonhole principle: if N items go into M containers, at least one container must hold ⌈N/M⌉ items — no distribution can keep every container below that. Enter the items and containers to get that guaranteed minimum, and set a target k to find how many items you must place to force some container to reach k, namely M·(k−1)+1. A simple idea with surprisingly deep consequences across combinatorics and computer science.Stirling Numbers CalculatorStirling numbers of the first (signed & unsigned) and second kind, S(n,k), by exact recurrence.

Need nPr? The Permutation calculator (nPr) derives it from n (total), r (chosen) in one step. For instance, with n (total) = 10 and r (chosen) = 3 it returns nPr = 720.

How to use it

  1. Enter your values: n (total), r (chosen).
  2. Read the result instantly: nPr.

Frequently asked questions

What does the Permutation calculator (nPr) actually compute?

It takes n (total) and r (chosen) and derives nPr from them. The calculation is live as you type, so the result updates on every change.

What information do I need to provide?

2 values: n (total) and r (chosen). Nothing else is required — no account, no file upload.

Can you show a worked example?

With n (total) = 10 and r (chosen) = 3, the calculator returns nPr = 720. Those figures come from running this exact tool, so you can reproduce them by entering the same values.

What happens if I enter larger values?

It moves a lot. Using n (total) = 20 and r (chosen) = 6 instead, nPr goes from 720 to 27,907,200 — which is why it is worth testing a few scenarios rather than trusting a single figure.

What does it give for smaller values?

Scaled down to n (total) = 5 and r (chosen) = 2, nPr comes out at 20. The relationship is worth checking at both ends before you rely on a single result.

When would I actually use this?

Counting possibilities before enumerating them: hands in a card game, passwords of a given shape, seatings around a table, or lottery odds.

What is the most common mistake?

Choosing a permutation when order does not matter. Picking three people from ten gives 720 arrangements but only 120 groups — the two differ by a factor of six here, and far more as the numbers grow.

What is the difference between the Permutation calculator (nPr) and the Combination calculator (nCr)?

This one returns nPr; the Combination calculator (nCr) returns nCr. That is the whole difference — open the one whose figure you need.

Where do the figures come from, and how current are they?

Counting formulas are exact by definition. Large factorials are computed with arbitrary precision where needed, so a result is not silently rounded into scientific notation.

Further reading

All guides