Skip to content
TheCalcUniverse

Permutation and Combination Calculator — Free Online Calculator

Calculate permutations (nPr) and combinations (nCr) with step-by-step factorial breakdown. Toggle between order matters vs.

✓ Tested formula & cited sources Formula verified 2026-01-15 Runs in your browser — inputs never sent anywhere

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

Full explanation ↓

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 ItemsThe total number of distinct items available to choose from. Must be a non-negative integer up to 170.
r
Items ChosenHow many items you are selecting at a time. Must be between 0 and n.
n!
n FactorialThe product of all positive integers from 1 to n: n × (n−1) × ... × 1. By convention, 0! = 1.
P(n,r)
PermutationNumber of ways to arrange r items from n when order matters: n!/(n−r)!
C(n,r)
CombinationNumber of ways to select r items from n when order does not matter: n!/(r!(n−r)!)
Permutations count ordered arrangements; combinations count unordered selections

How to Use

  1. Enter the total number of items (n) and how many to choose (r). Both must be non-negative integers with r ≤ n.
  2. Toggle "Does Order Matter?" to switch between permutations (order matters) and combinations (order does not matter).
  3. View the result, formula, and detailed step-by-step calculation showing each factorial value.
  4. Compare permutation vs. combination results — notice that combinations are always smaller because order no longer contributes distinct arrangements.
  5. 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.
Was this calculator helpful?
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

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator