Permutation and Combination Calculator — Free Online Calculator
Calculate permutations (nPr) and combinations (nCr) with step-by-step factorial breakdown. Toggle between order matters vs.
See it worked out
Example — Total Items (n) 5, Items Chosen (r) 3:
Permutation: 5P3
60
Type
Permutation
Formula
P(5,3) = 5! / (5 − 3)!
Formula Applied
5! / 2! = 120 / 2 = 60
n!
120
r!
6
(n−r)!
2
The formula
P(n,r) = n!/(n−r)! | C(n,r) = n!/(r!(n−r)!)
- n
- Total Items
- r
- Items Chosen
- n!
- n Factorial
- P(n,r)
- Permutation
- C(n,r)
- Combination
Worked example — Total Items (n) 5, Items Chosen (r) 3
Permutation: 5P3 = 60
How Permutations & Combos Works
P(n,r) = n!/(n−r)! | C(n,r) = n!/(r!(n−r)!)
Permutations count arrangements where order matters. Combinations count selections where order does not matter. The key difference is dividing by r! in combinations to eliminate counting different orders as distinct outcomes.
- n
- Total Items — The total number of distinct items available to choose from. Must be a non-negative integer up to 170.
- r
- Items Chosen — How many items you are selecting at a time. Must be between 0 and n.
- n!
- n Factorial — The product of all positive integers from 1 to n: n × (n−1) × ... × 1. By convention, 0! = 1.
- P(n,r)
- Permutation — Number of ways to arrange r items from n when order matters: n!/(n−r)!
- C(n,r)
- Combination — Number of ways to select r items from n when order does not matter: n!/(r!(n−r)!)
How to Use
- Enter the total number of items (n) and how many to choose (r). Both must be non-negative integers with r ≤ n.
- Toggle "Does Order Matter?" to switch between permutations (order matters) and combinations (order does not matter).
- View the result, formula, and detailed step-by-step calculation showing each factorial value.
- Compare permutation vs. combination results — notice that combinations are always smaller because order no longer contributes distinct arrangements.
- The maximum value of n is 170 due to JavaScript factorial overflow limits. For larger values, use the big-number calculator.
Understanding the Result
Permutations and combinations are fundamental counting techniques in combinatorics and probability. Permutations (order matters) count arrangements like passwords ("123" differs from "321"), race rankings (1st, 2nd, 3rd place), and seating arrangements. Combinations (order does not matter) count selections like lottery numbers (the same set of numbers wins regardless of draw order), committee members, and poker hands. The key mathematical insight is that the combination formula is the permutation formula divided by r! — dividing by r! removes the count of different orderings for the same set of items. The factorial function grows extremely fast: 10! = 3,628,800, and 20! is about 2.43 quintillion. This rapid growth is why the calculator caps n at 170 — beyond this, JavaScript's number type can no longer represent the factorial exactly. For larger values, you would need the big-number calculator with arbitrary-precision integers. Real-world applications include password security analysis (how many possible 8-character passwords?), tournament bracket design, genetics (gene combinations), and quality control sampling plans.
Frequently Asked Questions
- What is the difference between permutations and combinations?
- Permutations care about order: ABC, ACB, BAC are all different. Combinations treat ABC, ACB, BAC as the same selection. Think of a race: 1st/2nd/3rd place is a permutation (order matters). Choosing 3 team members is a combination (order does not matter). The combination formula is the permutation formula divided by r! — this removes the count of different orderings.
- What does 0! equal and why?
- 0! = 1 by mathematical convention. There is exactly one way to arrange zero items (the empty arrangement). This convention makes formulas work correctly: C(n,n) = n!/(n!×0!) = 1, meaning there is exactly one way to choose all items.
- Can r be greater than n?
- No. You cannot choose more items than are available. If r > n, the calculator returns 0 because there are zero ways to select r items from n available items. This is also why n must be at least r.
Cite this calculator
TheCalcUniverse. "Permutation and Combination Calculator — Free Online Calculator." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/permutation-combination-calculator/. Accessed July 24, 2026.
Embed this calculator on your site
You may also like
-
Probability
Compute joint (A∩B), union (A∪B), conditional P(A|B), and complement probabilities for independent or mutually…
-
Number Sequences
Identify arithmetic, geometric, and Fibonacci sequences. Find common difference, common ratio, nth-term formul…
-
Factor Calculator
Find all factors of any positive integer with a complete factor pairs table, total factor count, sum of factor…
-
Statistics
Comprehensive descriptive statistics calculator with a dynamic box-and-whisker plot. Computes the five-number …