Permutations and combinations calculator

Count how many ways you can choose r items from n, when order matters and when it does not.

Tier 0 · browser · unlimited

Choose r from n

Combinations C(n, r)
120
Permutations P(n, r)720
Permutations with repetition (nʳ)1000
Combinations with repetition220

Order matters, or it doesn't

A combination counts selections where order does not matter: choosing 3 people for a committee from 10 gives C(10, 3) = 120 possibilities. A permutation counts arrangements where order matters: awarding gold, silver and bronze among 10 runners gives P(10, 3) = 10 × 9 × 8 = 720. Each combination of 3 can be ordered in 3! = 6 ways, which is why 720 = 120 × 6.

With repetition, items can be chosen more than once: a 3-digit code from 10 digits has 10³ = 1,000 possibilities; choosing 3 scoops from 10 flavours where repeats are allowed gives C(12, 3) = 220.

Worked example: lottery odds

A lottery drawing 6 numbers from 60, like Brazil's Mega-Sena, has C(60, 6) = 50,063,860 combinations, so a single ticket wins the jackpot with probability 1 in 50,063,860.

How this works

Permutations multiply n × (n − 1) × … down r factors. Combinations use the same product divided step by step by 1, 2, … r, which keeps every intermediate value a whole number and avoids computing huge factorials. Both use exact big integers. With repetition, permutations are n to the power r and combinations are C(n + r − 1, r). If r is larger than n, selections without repetition are impossible and the page shows 0. Everything runs in your browser.

Frequently asked

What is the difference between a permutation and a combination?

Permutations count ordered arrangements (podium places); combinations count unordered groups (a committee).

What are the odds of winning a 6/49 lottery?

1 in C(49, 6) = 13,983,816.

What is nCr when r = 0?

1: there is exactly one way to choose nothing.

How big can n be?

Up to 10,000; results stay exact even with thousands of digits.

Sources

Reviewed Oct 17, 2026 · test vectors fixtures/calculators/math/permutations-combinations/