Permutations and combinations (with or without repetition)

n is the number of items available, r the number you pick. Combinations ignore order, permutations do not. Results are exact, even very large ones.

Permutations and combinations (with or without repetition)

Can an item be picked again?

Result

10Combinations C(n, r) — order does not matter

Permutations P(n, r) — order matters
60

Permutations and combinations (with or without repetition)

Inputs

Number of items n
5
Number picked r
3
Can an item be picked again?
Without repetition

How it is calculated

Permutations without repetition: P(n, r) = n! ÷ (n − r)!.

Result

Combinations C(n, r) — order does not matter

10
Permutations P(n, r) — order matters
60

How it is calculated

  1. Permutations without repetition: P(n, r) = n! ÷ (n − r)!.
  2. Combinations without repetition: C(n, r) = n! ÷ (r! × (n − r)!).
  3. With repetition: nʳ permutations and C(n + r − 1, r) combinations.
  4. Everything is computed with exact integers (BigInt), no rounding.

Example

n = 5, r = 3, without repetition: C(5, 3) = 10 combinations and P(5, 3) = 5 × 4 × 3 = 60 permutations.

Good to know

  • n and r are whole numbers from 0 up to 100,000.
  • Beyond 400 digits the result is shown as ≈ m × 10ⁿ.

When to use it

  • Count the possible lottery tickets, such as 6 numbers out of 49.
  • Count the possible podiums or rankings when order matters.
  • Count codes or passwords where the same symbol can come back.
  • For the chance that two given events happen, use Probability of two events.

Frequently asked questions

How do I know if order matters?

Ask whether swapping two picked items gives a different result. A gold–silver–bronze podium: yes, use permutations. A team or a lottery ticket: no, use combinations.

How many combinations are there for 6 numbers out of 49?

C(49, 6) = 13,983,816. One ticket has about a 1 in 14 million chance of matching all six.

How many 4-digit PIN codes exist?

With repetition and order: 10⁴ = 10,000 codes, from 0000 to 9999.

Updated October 10, 2026

Indicative result. For an important decision, check with a professional.