Permutation & Combination Calculator

Find permutations (nPr) and combinations (nCr) for any n and r, with full factorial steps shown.

🎲 Permutation & Combination Calculator
n - Total number of items
r - Items to choose / arrange

🎲 What is a Permutation & Combination Calculator?

A permutation and combination calculator computes the number of ways to select or arrange items from a set, the cornerstone of combinatorics and probability theory. The two operations differ in one key respect: permutations count ordered arrangements (the sequence matters), while combinations count unordered selections (only which items are chosen matters).

Real-world permutations appear whenever order is significant: assigning 1st, 2nd, and 3rd place prizes among 20 contestants uses P(20, 3) = 6,840 arrangements. Creating a 4-digit PIN from digits 0–9 without repetition uses P(10, 4) = 5,040. Scheduling the order of 5 tasks from a pool of 12 uses P(12, 5) = 95,040. In each case, swapping positions creates a meaningfully different outcome.

Combinations arise when the group itself is what matters: choosing 6 lottery numbers from 49 uses C(49, 6) = 13,983,816. Forming a 5-person committee from a club of 30 uses C(30, 5) = 142,506. Dealing a 5-card poker hand from a 52-card deck uses C(52, 5) = 2,598,960. A common mistake is applying permutations where combinations are correct, inflating the count by a factor of r!.

This calculator delivers both nPr and nCr instantly along with the factorial breakdown, letting you verify the arithmetic step by step - essential for statistics courses, competitive exams, probability problems, and game design.

📐 Formula

P(n, r)  =  n! ÷ (n − r)!
n = total number of distinct items in the set
r = number of items to select / arrange (r ≤ n)
! = factorial - n! = n × (n−1) × … × 2 × 1
Example: P(6, 2) = 6! ÷ 4! = 720 ÷ 24 = 30
C(n, r)  =  n! ÷ (r! × (n − r)!)
n = total number of distinct items
r = number of items to choose (order irrelevant)
Relation: C(n, r) = P(n, r) ÷ r!
Example: C(6, 2) = 6! ÷ (2! × 4!) = 720 ÷ (2 × 24) = 15

📖 How to Use This Calculator

Steps

1
Enter n - the total count of distinct items in your set (e.g., 52 for a deck of cards).
2
Enter r - how many items you are choosing or arranging (must be 0 ≤ r ≤ n).
3
Click Calculate - read nPr (ordered) and nCr (unordered) instantly with the factorial steps shown below.

💡 Example Calculations

Example 1 — Medals (Ordered)

How many ways to award Gold, Silver, Bronze to 3 of 8 athletes?

1
Order matters (Gold ≠ Silver), so use Permutation: n = 8, r = 3.
2
P(8, 3) = 8! ÷ (8−3)! = 8! ÷ 5! = (8×7×6×5!) ÷ 5! = 8×7×6 = 336.
P(8, 3) = 336 arrangements
Try this example →

Example 2 — Committee (Unordered)

How many ways to form a 4-person committee from 12 employees?

1
Order does not matter (committee is a set), so use Combination: n = 12, r = 4.
2
C(12, 4) = 12! ÷ (4! × 8!) = (12×11×10×9) ÷ (4×3×2×1) = 11,880 ÷ 24 = 495.
C(12, 4) = 495 committees
Try this example →

Example 3 — Poker Hand

How many unique 5-card poker hands can be dealt from a 52-card deck?

1
A poker hand is a set (order doesn't matter in the hand): n = 52, r = 5.
2
C(52, 5) = 52! ÷ (5! × 47!) = (52×51×50×49×48) ÷ (120) = 311,875,200 ÷ 120 = 2,598,960.
C(52, 5) = 2,598,960 hands
Try this example →

❓ Frequently Asked Questions

What is the difference between permutation and combination?+
A permutation counts ordered arrangements - the order of selection matters. A combination counts unordered selections - only which items are chosen matters, not the order. For example, selecting 3 letters from {A, B, C}: permutations give ABC, ACB, BAC, BCA, CAB, CBA (6 results), while combinations give just {A,B,C} (1 result). Choosing a PIN uses permutations; choosing lottery numbers uses combinations.
What is the formula for permutation nPr?+
P(n, r) = n! / (n − r)!, where n is the total number of items and r is how many you select. For example, P(5, 2) = 5! / 3! = 120 / 6 = 20. This counts the number of ways to pick and arrange r items from n distinct items in an ordered sequence.
What is the formula for combination nCr?+
C(n, r) = n! / (r! × (n − r)!). For example, C(5, 2) = 5! / (2! × 3!) = 120 / 12 = 10. Since order is ignored, each group of r items is counted once - exactly r! times fewer than permutations, which is why we divide P(n, r) by r! to get C(n, r).
How do I calculate 10C3 by hand?+
C(10, 3) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120. The shortcut: only compute the top r terms of n!, then divide by r!. The (n-r)! in the denominator cancels with the lower portion of n!. So for any C(n, r), compute (n × (n-1) × ... × (n-r+1)) / r! - far easier than computing full factorials.
What is 0! (zero factorial) and why is it 1?+
0! = 1 by mathematical convention. This ensures C(n, 0) = 1 (there is exactly one way to choose nothing from a set) and C(n, n) = 1 (exactly one way to choose everything). Without this definition, the combinatorics formulas would be undefined at the boundary cases. It also follows naturally from the recursive definition n! = n × (n−1)!: 1! = 1, so 0! = 1!/1 = 1.
When should I use permutations in real life?+
Use permutations when arrangement or sequence matters: awarding 1st/2nd/3rd place among contestants, creating a 4-digit PIN from 0–9 without repetition (P(10,4) = 5,040), scheduling the order of tasks, arranging books on a shelf, anagram counting, and any problem where position, rank, or sequence is meaningful. If swapping two selected items gives a different result, use permutations.
When should I use combinations in real life?+
Use combinations when only the selection group matters: picking lottery numbers (C(49,6) = 13,983,816), forming a committee, choosing pizza toppings, dealing cards, selecting a sample for a study, or choosing which projects to fund from a list. If swapping two selected items gives the same result, use combinations.
What is the symmetry property C(n, r) = C(n, n-r)?+
Choosing r items from n is equivalent to rejecting (n−r) items. C(10, 3) = C(10, 7) = 120. This symmetry is visible in Pascal's triangle, where each row reads the same from left and right. Practically, always compute using the smaller of r and (n−r) to minimize arithmetic: C(100, 97) = C(100, 3) = 161,700, which is far easier to compute directly.
How are combinations used in the binomial theorem?+
The binomial theorem states (a+b)^n = Σ C(n,k) a^(n-k) b^k for k from 0 to n. The coefficients C(n,k) are called binomial coefficients and form Pascal's triangle. For (a+b)^4: coefficients are C(4,0)=1, C(4,1)=4, C(4,2)=6, C(4,3)=4, C(4,4)=1, giving a⁴+4a³b+6a²b²+4ab³+b⁴. This connection makes combinatorics central to algebra and probability.
What is the maximum n this calculator can handle accurately?+
The calculator uses JavaScript's 64-bit floating point, which represents integers exactly up to 2^53 (about 9 quadrillion). For very large n, factorials overflow to Infinity. In practice, nCr and nPr results remain representable for n up to about 60–70 for exact integer results. The calculator uses a numerically stable approach to delay overflow as long as possible.