Permutation & Combination Calculator

Compute nPr (permutations), nCr (combinations), factorials, and combinations with repetition — with full step-by-step working.

Pick a mode

Tap a tab — results update live as you type.

n
n
050
r
r
050
Order matters?No (combination)
Live calculation

C(10, 3) — choose 3 of 10

120

nCr = n! / (r!(n − r)!) = 10! / (3! × 7!)

n!

3 628 800

factorial of n

r!

6

factorial of r

(n − r)!

5040

remaining factorial

Other count

720

nPr if you swap order rule

How the count grows with r r from 0 to n
r = 0 r = 3 r = n
ConceptFormulaExample
Permutation nPrn! / (n − r)!P(5, 3) = 60
Combination nCrn! / (r! (n − r)!)C(5, 3) = 10
Permutation + rep.nr5³ = 125
Combination + rep.C(n + r − 1, r)C(7, 3) = 35
Factorial n!1 × 2 × … × n5! = 120

The Method

Permutations vs combinations

A permutation counts ordered arrangements: how many ways can you arrange r items out of n, where rearranging them counts as a new outcome? The answer is n!/(n−r)!. A combination counts unordered selections: how many ways can you choose r items out of n, where order does not matter? The answer is n!/(r!(n−r)!) — the famous "n choose r" or binomial coefficient. With repetition allowed, the formulas become nr (ordered) and C(n+r−1, r) (unordered).

Working for the current input

C(10, 3) = 10! / (3! × 7!) = 120
n total items (10)
r chosen (3)
n! factorial (3 628 800)
r! factorial of r (6)
(n−r)! remainder (5040)
R result (120)

About This Tool

What Is a Permutation & Combination Calculator?

A permutation and combination calculator turns two simple numbers — n (how many items to pick from) and r (how many to pick) — into the count of possible arrangements. Switch modes at the top of the calculator to choose between nPr (ordered), nCr (unordered), permutations with repetition, combinations with repetition, or a plain factorial.

These formulas are the foundation of combinatorics and appear in probability (lottery odds, hand strength in poker), cryptography (key spaces), scheduling (how many orderings of n tasks), genetics (allele combinations), and any problem that asks "how many ways can this happen?".

This calculator handles factorials up to n = 170 using IEEE 754 double-precision arithmetic. For larger values, results overflow to infinity — beyond that you need an exact big-integer library. For convenience the calculator also computes the other classical count side-by-side: if you have nCr, it shows the corresponding nPr, and vice versa, so you can see what changes when order starts (or stops) mattering.

Use this free permutation and combination calculator for homework, probability problems, statistics, lottery odds, or anywhere you need a quick combinatorial answer. All calculation runs in your browser — no sign-up, no tracking.

Five Modes

nCr, nPr, with-repetition variants, and pure factorial — all in one form.

Growth Curve

See how the count grows with r for fixed n — useful for intuition.

Cross-Compare

Shows the corresponding count if you swap "order matters" — see the ratio at a glance.

Step-by-Step Working

Substituted formula and intermediate factorials — exactly as you would write them.

100% Free & Private

No account, no tracking — every calculation runs locally in your browser.

Up to n = 170

Handles factorials all the way up to the IEEE 754 overflow boundary.

How to Use This
Permutation & Combination Calculator

Pick a mode, type n and r, read the count — and see the working step by step.

1

Decide if Order Matters

If a different ordering counts as a different outcome (passwords, podium finishes), pick a permutation mode. If not (lottery numbers, committees), pick combination.

2

Allow Repetition or Not

If the same item can be picked more than once (dice rolls, multi-character passwords), pick a + repetition mode.

3

Enter n and r

Type n (total items) and r (how many you pick) directly, or drag the sliders for quick exploration up to n = 50.

4

Read the Big Number

The headline number is the count of arrangements. The line above shows the formula in plain language; the line below shows the formula with values substituted.

5

Check the Stat Tiles

The four tiles show n!, r!, (n − r)!, and the cross-mode count — useful for cross-checks.

6

Inspect the Growth Curve

The chart plots the count as a function of r for the chosen n. nCr peaks at r = n/2; nPr grows monotonically; nr grows exponentially.

Frequently Asked Questions

Everything you need to know about nPr, nCr, factorials and combinations with repetition.

A permutation counts ordered arrangements: ABC and BCA are different outcomes. A combination counts unordered selections: ABC and BCA are the same outcome. As a result, nCr = nPr / r! — every combination of r items can be rearranged in r! ways, and each of those rearrangements is a separate permutation.

Use nPr whenever order matters — for example, the number of possible passwords of length r using r distinct characters, or the number of ways to fill 1st, 2nd, 3rd place from n runners. Use nCr when order is irrelevant — for example, the number of 5-card poker hands from a 52-card deck, or the number of committees of size r drawn from n people.

Combinations with repetition (sometimes called multisets) allow the same item to appear more than once in the selection. The formula is C(n + r − 1, r). Example: how many ways to scoop r ice-cream balls from n flavours, with repeats allowed? For n = 5, r = 3 that is C(7, 3) = 35.

Permutations with repetition count ordered arrangements where each position can independently take any of the n values. The formula is simply nr. Example: a 4-character PIN from 10 digits gives 10⁴ = 10 000 combinations.

n! ("n factorial") is the product of all positive integers up to n: n! = 1 × 2 × 3 × … × n. By convention 0! = 1 (this makes the nCr and nPr formulas work for the boundary r = 0 case). Factorials grow extremely fast — 13! is already over 6 billion, 20! is about 2.4 × 10¹⁸, and 170! is near the IEEE 754 double-precision overflow boundary (~10³⁰⁸).

It is a useful convention. The empty product is 1 (just as the empty sum is 0), and defining 0! = 1 keeps formulas like nCr = n!/(r!(n−r)!) consistent for r = 0 and r = n. It is also the unique value that makes the recursion n! = n × (n−1)! extend cleanly down to 0.

C(n, r) = C(n, n − r). Choosing r items to include is the same as choosing (n − r) items to leave out. This is why the binomial coefficients in Pascal's triangle are symmetric across each row. Numerically, nCr is largest when r is close to n/2.

Combinations show up everywhere in probability. The chance of drawing a specific hand of r cards from a deck of n is 1 / C(n, r). The probability of exactly k successes in n independent trials with success probability p is the binomial distribution: C(n, k) × pk × (1−p)n−k. Lottery odds, poker hand probabilities, and quality-control sampling all reduce to combinations.

Because 170! ≈ 7.26 × 10³⁰⁶ is the largest factorial that fits in an IEEE 754 double-precision number. 171! overflows to Infinity. For larger n you need an exact big-integer library or arbitrary-precision arithmetic.