Combinations & Permutations Calculator
Compute nCr, nPr and related combinatorics values.
Overview
The Combinations and Permutations Calculator handles the four classic counting questions: how many ways to choose r items from n, how many ways to arrange them in order, and the same with and without repetition. Just pass in n and r and the calculator returns nCr, nPr and related figures.
It is built for probability students, lottery curious folks, password-strength sceptics and developers sizing a search space. Knowing whether your problem needs combinations (order doesn't matter) or permutations (order does) is half the battle, and the tool reminds you which is which.
How it works
The permutation count nPr = n! / (n - r)! is the number of ordered arrangements of r items drawn from n distinct items. The combination count nCr = n! / (r! * (n - r)!) is the number of unordered selections, equal to nPr / r!.
With repetition allowed, ordered arrangements become n^r and unordered selections become C(n + r - 1, r) (the stars-and-bars formula). The tool uses an iterative product so it stays exact even when n! would overflow.
Examples
nCr where n=5, r=2 → 10
nPr where n=5, r=2 → 20
Pick 6 numbers from 49 (Lotto) → 13,983,816 combinations
3-digit PIN with digits 0-9, no repeats → 720 permutations
FAQ
What's the rule for combinations vs permutations?
Use combinations when the order of selection doesn't matter (lottery balls in a hat). Use permutations when it does (the order people finish a race).
Why is nCr always less than or equal to nPr?
Because each unordered combination corresponds to r! ordered permutations.
How big can n and r be?
The calculator handles arbitrary-precision integers, so n into the thousands is fine. The number itself can get astronomically large, but the calculator returns the exact digit string.
What if r is greater than n?
For combinations or permutations without repetition the answer is 0. With repetition allowed, you can have r larger than n.
Is 0! really 1?
Yes — it's a convention that makes the formulas consistent. There's exactly one way to arrange zero items.