Permutation and Combination Calculator

Permutation & Combination Calculator

Calculate permutations P(n,r) and combinations C(n,r) with step-by-step solutions and visual diagrams

Input Parameters
The total number of distinct objects
The number of objects to choose/arrange
Quick Examples
Results Comparison
Permutation P(n,r)
—
Combination C(n,r)
—
P(n,r) = C(n,r) × r!
Permutation Result
P(n, r) = n! / (n - r)!
—
Arrangement Diagram
Step-by-Step Calculation
Combination Result
C(n, r) = n! / [r! × (n - r)!]
—
Selection Diagram
Step-by-Step Calculation
Factorial Breakdown
ValueFactorialResultExpanded
Reference Guide

Permutation

A permutation is an arrangement of objects in a specific order. Order matters.

P(n, r) = n! / (n - r)!
  • Arranging r books from n on a shelf
  • Selecting a president, VP, secretary from n people
  • Creating passwords of length r from n characters

Combination

A combination is a selection of objects without regard to order. Order does not matter.

C(n, r) = n! / [r!(n - r)!]
  • Choosing r people from n for a committee
  • Selecting r cards from a deck of n
  • Picking r lottery numbers from n possible
Key Properties

Permutation Properties

  • P(n, 0) = 1
  • P(n, 1) = n
  • P(n, n) = n!
  • P(n, r) = 0 if r > n
  • P(n, r) = n × P(n-1, r-1)

Combination Properties

  • C(n, 0) = 1
  • C(n, 1) = n
  • C(n, n) = 1
  • C(n, r) = C(n, n-r)   (Symmetry)
  • C(n, r) = C(n-1, r-1) + C(n-1, r)   (Pascal's Identity)
Pascal's Triangle (Combinations)

Permutation and Combination Calculator — Complete Guide with Examples & Formulas


Introduction

Ever stared at a math problem asking “how many ways can you arrange 5 books on a shelf?” or “how many different teams of 3 can you pick from 10 players?” and felt stuck? That’s exactly where our Permutation and Combination Calculator comes in.

 

This tool instantly computes both permutations and combinations for any values of n and r you enter — with full step-by-step breakdowns, visual diagrams, and factorial tables. No more second-guessing your manual calculations or digging through textbooks for formulas.

 

Students use it to verify homework answers. Teachers rely on it to create example problems. Data scientists reach for it when calculating probability distributions. Business analysts use it for scenario planning. Anyone who needs to count arrangements or selections — without doing factorial math by hand — benefits from this calculator.

 

The real power? You see every step of the calculation, not just the final number. That means you learn the “why” behind the answer, not just the “what.” Plus, the side-by-side comparison view lets you instantly see how permutations and combinations differ for the same inputs — which is one of the most common points of confusion in counting problems.

 

Whether you’re prepping for an exam, writing code that involves combinatorics, or just curious how many different pizza combinations you can make with 8 toppings, this calculator has you covered.

 

What Is a Permutation and Combination Calculator?

A Permutation and Combination Calculator is a mathematical tool that computes the number of ways to arrange or select items from a larger set.

 
  • A permutation counts arrangements where order matters. Think: lining up people in a row, assigning distinct roles, or creating passwords.
  • A combination counts selections where order does not matter. Think: choosing team members, picking lottery numbers, or selecting toppings.
 

The concept dates back to the 17th century, with roots in the work of Blaise Pascal and Pierre de Fermat on probability theory. Pascal’s Triangle — which you’ll see visualized right in this calculator — was actually invented as a tool for computing combinations centuries ago.

 

These two counting methods form the backbone of combinatorics, the branch of mathematics focused on counting, arranging, and grouping. Without them, we couldn’t calculate probabilities, analyze algorithms, or solve optimization problems.

 

This calculator automates the factorial-heavy computations that make manual calculation tedious and error-prone, especially as numbers grow beyond n = 10 or so.

 

How This Calculator Works

Inputs

Input
Meaning
Constraint
nTotal number of distinct objectsNon-negative integer (0–170)
rNumber of objects to choose or arrangeNon-negative integer, r ≤ n

Outputs

  • P(n, r) — The permutation result: number of ordered arrangements
  • C(n, r) — The combination result: number of unordered selections
  • Step-by-step solution — Every factorial, substitution, and division shown
  • Factorial breakdown table — Values of n!, r!, and (n−r)!
  • Visual diagrams — Slot diagrams for permutations, selection diagrams for combinations
 

Formulas

Permutation:

 
 

P(n, r) = n! / (n − r)!

Combination:

 
 

C(n, r) = n! / [r! × (n − r)!]

Where n! (n factorial) = n × (n−1) × (n−2) × … × 2 × 1, and 0! = 1.

 

Step-by-Step Process

  1. Read and validate inputs n and r
  2. Compute n! (factorial of n)
  3. Compute (n − r)! (factorial of n minus r)
  4. For permutation: divide n! by (n−r)!
  5. For combination: also compute r!, then divide n! by (r! × (n−r)!)
  6. Display results with full working
 

Formula Explained

Permutation Formula

 

P(n, r) = n! / (n − r)!

Variables:

  • n = total number of items available
  • r = number of positions to fill
  • n! = n × (n−1) × … × 1
  • (n−r)! = factorial of the remaining items
 

Why it works: You have n choices for the first position, (n−1) for the second, (n−2) for the third, and so on until you’ve filled r positions. The product of these decreasing choices is exactly n!/(n−r)!.

 

Example: P(5, 3) = 5! / 2! = 120 / 2 = 60

 

There are 60 ways to arrange 3 items chosen from 5.

 

Combination Formula

 

C(n, r) = n! / [r! × (n − r)!]

The extra r! in the denominator accounts for the fact that in combinations, the r selected items can be rearranged among themselves in r! ways — but we don’t care about that order. So we divide the permutation count by r! to collapse all orderings of the same group into a single combination.

 

Example: C(5, 3) = 5! / (3! × 2!) = 120 / (6 × 2) = 10

 

There are 10 ways to choose 3 items from 5 (order doesn’t matter).

 

The Key Relationship

 

P(n, r) = C(n, r) × r!

This makes intuitive sense: every combination of r items can be rearranged in r! ways, giving you all the permutations.

 

Common Mistakes with the Formulas

  • Using combination when order matters — If you’re assigning specific roles (president, vice-president, secretary), that’s a permutation, not a combination.
  • Using permutation when order doesn’t matter — If you’re just picking a committee where all members are equal, use combination.
  • Forgetting that 0! = 1 — This is a definition, not a calculation. It ensures formulas work correctly at boundary values.
  • Entering r > n — You cannot choose more items than are available. The calculator will flag this error.
 

How to Use the Calculator

  1. Enter the value of n — This is the total number of distinct objects in your set. For example, if you have 10 players, enter 10.
  2. Enter the value of r — This is how many objects you want to select or arrange. If you’re picking a team of 4, enter 4.
  3. Choose your mode — Click “Both” to see permutation and combination side by side, or select either individually.
  4. Click Calculate — Or press Enter on your keyboard.
  5. Review the results — You’ll see the numerical answer, the formula with values plugged in, a step-by-step breakdown, and visual diagrams.
  6. Use Quick Examples — Click any chip below the inputs to auto-fill common (n, r) pairs and see instant results.
 

Tips:

  • Use the “Both” tab when you’re learning — seeing P and C side by side builds intuition about when order matters.
  • Check the step-by-step section if your answer seems off — you can trace every calculation.
  • The Pascal’s Triangle diagram at the bottom is a great reference for combination values.
 

Example Calculations

Example 1: Basic Permutation (Beginner)

Problem: How many ways can you arrange 3 books from a shelf of 6?

 
  • n = 6, r = 3
  • P(6, 3) = 6! / 3! = 720 / 6 = 120
 

There are 120 different arrangements.

 

Example 2: Basic Combination (Beginner)

Problem: How many ways can you choose 3 books from 6 to take home?

 
  • n = 6, r = 3
  • C(6, 3) = 6! / (3! × 3!) = 720 / 36 = 20
 

There are 20 different selections. Notice this is far fewer than the permutation — because order doesn’t matter.

 

Example 3: Team Selection (Intermediate)

Problem: A coach has 12 players. How many starting lineups of 5 can be chosen?

 
  • n = 12, r = 5
  • C(12, 5) = 12! / (5! × 7!) = 479,001,600 / (120 × 5,040) = 792
 

Example 4: Password Creation (Intermediate)

Problem: A 4-digit PIN uses digits 0–9 with no repeats. How many PINs are possible?

 
  • n = 10, r = 4
  • P(10, 4) = 10! / 6! = 3,628,800 / 720 = 5,040
 

Example 5: Lottery Odds (Advanced)

Problem: A lottery requires choosing 6 numbers from 49. What are the odds of one specific ticket winning?

 
  • n = 49, r = 6
  • C(49, 6) = 49! / (6! × 43!) = 13,983,816
 

Your odds are 1 in 13,983,816 — roughly 0.00000715%.

 

Example 6: Boundary Case

Problem: How many ways to choose 0 items from 7?

 
  • n = 7, r = 0
  • C(7, 0) = 7! / (0! × 7!) = 5,040 / (1 × 5,040) = 1
 

There’s exactly 1 way to choose nothing — by choosing nothing.

 

Comparison Table

n
r
P(n,r)
C(n,r)
Ratio P/C
5220102! = 2
83336563! = 6
1045,0402104! = 24
12595,0407925! = 120
6672016! = 720

The ratio is always r! — confirming the relationship P(n,r) = C(n,r) × r!.

 

Benefits

  1. Instant results — No manual factorial multiplication needed
  2. Step-by-step transparency — See every calculation, not just the answer
  3. Error prevention — Built-in validation catches invalid inputs before you compute
  4. Side-by-side comparison — Instantly see how permutations and combinations differ
  5. Visual learning — Diagrams make abstract counting concepts concrete
  6. Handles large numbers — BigInt support up to n = 170 without overflow
  7. Educational value — Great for self-study, not just answer-checking
  8. Free and unlimited — No sign-up, no usage caps
  9. Works on all devices — Fully responsive for phones, tablets, and desktops
  10. Factorial reference table — Quickly look up related factorial values
  11. Quick examples — One-click access to common problem types
  12. Pascal’s Triangle visualization — Built-in reference for combination values
 

Features

  • Dual-mode calculation — Compute P(n,r), C(n,r), or both simultaneously
  • Tab-based interface — Switch between “Both,” “Permutation,” and “Combination” views
  • Step-by-step breakdown — 6–7 detailed steps per calculation with full working
  • Factorial expansion — See factorials written out (e.g., 5! = 5 × 4 × 3 × 2 × 1)
  • Canvas-based diagrams — Slot diagrams for permutations, circular selection diagrams for combinations
  • Pascal’s Triangle — Always-visible 8-row reference with color-coded values
  • Quick example chips — Pre-loaded (n, r) pairs for instant demonstration
  • Keyboard support — Press Enter to calculate from any input field
  • Scientific notation — Extremely large results displayed with exponent notation
  • Input validation — Real-time error messages for non-integers, negative values, and r > n
 

Applications

Education

Students encounter permutations and combinations in algebra, statistics, probability, and discrete math courses. This calculator serves as both a homework checker and a learning tool — the step-by-step output teaches the process, not just the answer.

 

Probability and Statistics

Every probability calculation involving equally likely outcomes starts with counting those outcomes. Whether you’re computing binomial probabilities, hypergeometric distributions, or poker hand odds, you need combinations as a building block.

 

Computer Science and Engineering

Algorithm analysis frequently involves combinatorics. The number of possible sorting orders, binary tree structures, graph colorings, or hash collisions all rely on permutation and combination formulas.

 

Business and Finance

Portfolio managers calculate how many different investment combinations are possible from a pool of assets. Project managers estimate the number of task orderings or team assignments. Marketing teams count possible A/B test variations.

 

Science and Research

In biology, combinations count possible genetic crosses and protein folding pathways. In chemistry, they enumerate molecular arrangements. In clinical trials, they determine the number of ways to assign patients to treatment groups.

 

Daily Life

  • How many different meals can you make from a menu?
  • How many outfit combinations from your wardrobe?
  • How many different routes through a set of stops?
  • How many lottery ticket combinations exist?
 

Advantages

  • Speed — Computes in milliseconds what would take minutes by hand
  • Accuracy — Eliminates arithmetic mistakes common in manual factorial calculations
  • Depth — Doesn’t just give answers; explains the entire process
  • Flexibility — Handles everything from trivial (C(3,1)) to massive (C(170,85))
  • Accessibility — No software to install, works in any browser
  • Visual reinforcement — Diagrams help learners who struggle with pure abstraction
 

Limitations

  • Maximum n = 170 — Beyond this, factorial values exceed JavaScript’s numeric limits even with BigInt for display purposes. In practice, values above ~30 already produce numbers too large for most real-world interpretation.
  • Integer inputs only — Permutations and combinations are defined only for non-negative integers. This calculator doesn’t handle the generalized gamma function extension.
  • No repetition allowed — The formulas used assume each item is selected at most once. For permutations/combination with repetition, different formulas apply (n^r and C(n+r−1, r) respectively).
  • No partial computation — You must enter complete values; the calculator doesn’t solve for n or r given a result.
 

Tips for Accurate Results

  1. Double-check whether order matters before choosing permutation or combination — this is the #1 source of wrong answers.
  2. Verify your n value — Make sure you’re counting the total set correctly. Misidentifying n is a common error.
  3. Use the “Both” mode when unsure — seeing both results often triggers the right intuition.
  4. Check the step-by-step — If your answer seems too large or too small, trace through the steps to find where your reasoning went wrong.
  5. Use quick examples to validate your understanding before entering custom values.
  6. Remember boundary cases — C(n,0) = 1, C(n,1) = n, C(n,n) = 1, P(n,n) = n!.
  7. Watch for the symmetry property — C(n,r) = C(n, n−r). Sometimes computing the smaller r is easier mentally.
 

Common Mistakes

  • Confusing “arrange” with “choose” — “Arrange” signals permutation (order matters); “choose” or “select” signals combination.
  • Counting n incorrectly — Including or excluding items from the total set. Example: counting “10 digits” when digits 0–9 give n = 10, not 9.
  • Double-counting — Selecting the same group in different orders when order doesn’t matter.
  • Ignoring the “without replacement” assumption — These formulas assume items aren’t repeated. If replacement is allowed, use n^r for permutations with repetition.
  • Mental math overflow — Trying to compute 12! by hand. Factorials grow deceptively fast — use the calculator.
  • Mixing up n and r — Entering the chosen count as n and the total as r. Always: n = total, r = chosen.
 

Frequently Asked Questions

What is the difference between permutation and combination?

A permutation counts arrangements where order matters — ABC and BCA are different permutations. A combination counts selections where order does not matter — ABC and BCA are the same combination. Use permutation for rankings, assignments, and sequences. Use combination for groups, committees, and sets.

 

What does n! mean?

n! (read as “n factorial”) is the product of all positive integers from 1 to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1. Factorials are the building blocks of both permutation and combination formulas.

 

Can r be larger than n?

No. You cannot select or arrange more items than are available. If r > n, both P(n,r) and C(n,r) are zero. The calculator will display an error if you enter r > n.

 

What is the largest n value this calculator supports?

The calculator supports n up to 170. Beyond that, factorial values become too large for practical display. For most real-world problems, even values above 30 produce astronomically large results.

 

Why is 0! equal to 1?

It’s a definition that makes formulas consistent. If 0! were 0, then C(n,0) would involve division by zero. Setting 0! = 1 ensures that C(n,0) = 1 (there’s exactly one way to choose nothing) and the permutation/combination formulas work for all valid inputs.

 

How do I know whether to use permutation or combination?

Ask yourself: “Does changing the order create a different result?” If yes, use permutation. If no, use combination. For example, assigning 3 distinct job titles to 5 people is a permutation (swapping titles changes the result). Choosing 3 people for a committee is a combination (swapping members doesn’t change the committee).

 

What is Pascal’s Triangle and how does it relate to combinations?

Pascal’s Triangle is a triangular array where each number equals C(n,r) for that row and position. Each number is the sum of the two numbers above it — this reflects Pascal’s Identity: C(n,r) = C(n−1, r−1) + C(n−1, r). The calculator displays an interactive Pascal’s Triangle for reference.

 

Can this calculator handle permutations with repetition?

No. This calculator handles permutations without repetition (each item used at most once). For permutations with repetition, the formula is simply n^r. For example, the number of 4-digit PINs with repeated digits allowed is 10^4 = 10,000.

 

How are permutations used in probability?

Permutations count the number of ordered outcomes in a sample space. To find the probability of a specific ordered event, divide the number of favorable permutations by the total number of permutations. For example, the probability of drawing 3 specific cards in order from a deck of 52 is 1/P(52,3).

 

What is the relationship between permutation and combination?

They’re connected by the formula: P(n,r) = C(n,r) × r!. Every combination of r items can be rearranged in r! different ways, producing all the permutations. This is why the calculator shows them side by side — the ratio is always r!.

 

How do combinations relate to the binomial theorem?

The coefficients in the binomial expansion (x + y)^n are exactly the combination values C(n,0), C(n,1), …, C(n,n). This is why combinations are also called binomial coefficients. They appear throughout algebra, probability, and statistics.

 

What happens when r equals n?

When r = n: P(n,n) = n! (you’re arranging all items) and C(n,n) = 1 (there’s only one way to select all items — take everything). For example, P(5,5) = 120 and C(5,5) = 1.

 

What happens when r equals 0?

P(n,0) = 1 and C(n,0) = 1. There is exactly one way to arrange or choose zero items — by doing nothing. This may feel counterintuitive, but it’s mathematically consistent and necessary for formulas to work.

 

Can I use this for lottery probability calculations?

Yes. Lottery problems are classic combination problems. For a 6/49 lottery, C(49,6) = 13,983,816, so your odds of winning with one ticket are 1 in 13,983,816. Enter n = 49 and r = 6 in combination mode.

 

How are combinations used in statistics?

Combinations appear in the binomial distribution (choosing which trials succeed out of n), the hypergeometric distribution (drawing without replacement), and confidence interval calculations. Any time you count equally likely outcomes, combinations are likely involved.

 

Is this calculator accurate for large numbers?

Yes. The calculator uses BigInt arithmetic, which handles integers of arbitrary size without the rounding errors that affect standard floating-point math. Results up to n = 170 are exact.

 

What does “order matters” mean in practical terms?

It means that AB and BA are counted as different outcomes. If you’re picking a president and vice-president from a club, putting Alice as president and Bob as VP is different from Bob as president and Alice as VP. That’s order mattering — use permutation.

 

Can I calculate combinations for negative numbers?

No. Combinations and permutations are defined only for non-negative integers. The calculator will reject negative inputs. The generalized binomial coefficient (which allows negative n) is a different concept not covered here.

 

How fast do factorials grow?

Extremely fast. 10! = 3,628,800. 20! ≈ 2.4 × 10^18. 50! ≈ 3 × 10^64. 100! ≈ 9.3 × 10^157. This explosive growth is why manual calculation becomes impractical beyond very small values — and why this calculator is valuable.

 

What’s the symmetry property of combinations?

C(n,r) = C(n, n−r). Choosing 3 items from 10 is the same as choosing 7 to exclude. This is useful because computing C(10,3) is easier than C(10,7) by hand, though the calculator handles both equally well.

 

Can I embed this calculator on my own website?

This calculator is designed for Calculators4All.com. Check the site’s terms for embedding permissions. The HTML is self-contained for easy integration.

 

Related Calculators

For more mathematical tools, explore these calculators on Calculators4All.com:

 
  1. Factorial Calculator — Compute n! directly for any non-negative integer
  2. Probability Calculator — Calculate probabilities for events and sample spaces
  3. Binomial Distribution Calculator — Uses combinations as core coefficients
  4. Combination with Repetition Calculator — When items can be selected multiple times
  5. Permutation with Repetition Calculator — Arrangements allowing repeated elements
  6. Scientific Calculator — General-purpose advanced math computations
  7. Statistics Calculator — Mean, median, standard deviation, and more
  8. Combinatorics Calculator — Broader counting problems beyond P and C
  9. Number System Converter — Convert between binary, decimal, octal, and hex
  10. Exponent Calculator — Compute powers and roots
  11. Ratio Calculator — Simplify and solve ratios
  12. Fractions Calculator — Add, subtract, multiply, and divide fractions
  13. Percentage Calculator — Percentage increase, decrease, and conversion
  14. Standard Deviation Calculator — Measure data spread
  15. Math Problem Solver — Step-by-step solutions for various math topics
 

Final Thoughts

Permutations and combinations are among the most practical math concepts you’ll ever learn. They show up in probability, statistics, computer science, business, and everyday decision-making. The formulas are simple — but the calculations get messy fast, especially once factorials climb into the hundreds of thousands.

 

This Permutation and Combination Calculator eliminates the computational burden while teaching you the process. Every result comes with a full step-by-step breakdown, visual diagrams, and a factorial reference table. Whether you’re a student learning counting principles for the first time, a professional computing probability distributions, or just someone curious about how many ways you can arrange your bookshelf — this tool delivers accurate, transparent results in seconds.

 

Bookmark this page and come back whenever you need to count arrangements or selections. And explore the full collection of math, finance, health, and engineering tools at Calculators4All.com — your one-stop destination for free, reliable online calculators.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top