Permutation and Combination Calculator

MATH · STATISTICS

Set size (n) & subset size (r)

Calculated on this device
Enter a whole number between 0 and 1,000 for total items n.
Enter a whole number for subset size r.

PERMUTATIONS P(6, 2) · COMBINATIONS C(6, 2)

30

Permutations (order matters): 30 · Combinations (order doesn't matter): 15

Formula:P(n,r) = n! ÷ (n−r)! · C(n,r) = n! ÷ [r!(n−r)!]

Permutations (order matters)302 digits
Combinations (order ignored)152 digits

HOW IT WORKS

Permutations (nPr) vs. combinations (nCr)

Both count ways to select r items from a set of n items. The key difference is whether the order of selection matters.

01

Permutations Without Repetition: P(n, r)

Order matters (e.g., race podiums or PIN codes without repeats):

P(n, r) = n! ÷ (n − r)!
02

Combinations Without Repetition: C(n, r)

Order does not matter (e.g., lottery tickets or committee selection):

C(n, r) = n! ÷ [ r! · (n − r)! ]
03

With Repetition Allowed

When items can be reused, ordered arrangements equal nʳ and unordered multisets equal C(n + r − 1, r).

COMBINATORICS GUIDE

How to tell permutations from combinations

Does swapping two chosen items create a new outcome?

If swapping A and B produces a different outcome (like 1st place vs. 2nd place), use permutations. If {A, B} and {B, A} are the same group (like two toppings on a pizza), use combinations. Once you know the total outcome count, compute event odds with our Probability Calculator or plan survey sizes with the Sample Size Calculator.

Frequently asked questions

What is P(n, 0) and C(n, 0)?

Both equal 1, because there is exactly one way to choose nothing (the empty set).

Why is P(n, r) always at least as large as C(n, r)?

Every combination of r distinct items can be ordered in r! different ways, so P(n, r) = r! × C(n, r).

How does this handle huge numbers like C(100, 50)?

It uses JavaScript BigInt with multiplicative cancellation so exact 30+ digit integers are computed instantaneously without overflow.

What is C(n + r − 1, r) used for?

Known as “stars and bars,” it counts unordered selections when items can be repeated—for example, picking 3 scoops of ice cream from 5 flavors.

All combinatorics run locally in your browser.