🔢 Permutation & Combination Calculator

Enter n and r to get nPr, nCr, and their with-repetition variants — computed exactly using BigInt arithmetic.

🔢 n and r
Results
Permutations (nPr)
Combinations (nCr)
Perm. with Repetition (nʳ)
Comb. with Repetition
Formulas Used
🔢

Enter n and r to calculate permutations and combinations

Guide

About the Permutation & Combination Calculator

Last updated: July 2026 · Reviewed by the NeftCal editorial team

A permutation and combination calculator counts exactly how many ways you can arrange or select items from a group — instantly and exactly, even for large numbers. Enter the total number of items (n) and how many you're choosing (r), and this free calculator returns nPr (permutations, where order matters), nCr (combinations, where order doesn't matter), and their with-repetition variants, all computed using exact BigInt arithmetic so nothing gets rounded off. Whether you need an nPr calculator for a seating arrangement problem or an nCr calculator for a committee-selection problem, this tool shows the exact factorial substitution behind every result.

What Permutations and Combinations Measure

A permutation counts the number of ways to arrange r items from a pool of n when the order matters — ABC and BCA count as different outcomes. A combination counts the number of ways to choose r items from n when order does not matter — ABC and BCA count as the same selection. Both without-repetition formulas rely on factorials (n!), while the with-repetition variants (nʳ and C(n+r−1, r)) allow the same item to be picked more than once.

Who Should Use This Calculator

This tool is built for students learning combinatorics and probability, competitive exam candidates practicing nPr/nCr problems, security analysts assessing password or PIN brute-force difficulty, event planners counting seating arrangements, researchers in genetics or combinatorics, and anyone who needs an exact count of arrangements or selections without manual factorial arithmetic.

Why Permutation and Combination Matter

Counting problems show up everywhere probability is involved — from lottery odds to card game hands to cryptographic key spaces. Permutations and combinations give an exact, provably correct count rather than an estimate, which is essential in fields like security (where brute-force difficulty must be calculated precisely) and probability theory (where exact counts of outcomes are the foundation of every calculation).

Real-World Applications

Security professionals use permutations with repetition to calculate how many possible PINs or passwords exist for a given length and character set. Event planners use permutations to count seating arrangements or scheduling orders. Committee and team selection uses combinations to count how many distinct groups can be formed. Card game and lottery odds rely on combinations to count equally likely hands or ticket outcomes. Geneticists and combinatorics researchers use both to count sequence arrangements and trait combinations.

Tips for Accurate Results

  • Ask yourself first: does order matter? If yes, use nPr; if no, use nCr.
  • Ask second: can items repeat? If yes, use the with-repetition variant instead of the standard formula.
  • Remember r cannot exceed n in the standard (without-repetition) modes — the calculator will flag this as invalid.
  • For very large n, trust the BigInt-powered result over manual calculator apps, which often round large factorials and lose precision.
Formula

The Permutation & Combination Formulas, Explained

How this calculator computes nPr, nCr, and their with-repetition variants

Permutations (nPr) — order matters, no repetition
nPr = n! ÷ (n − r)!

Combinations (nCr) — order doesn't matter, no repetition
nCr = n! ÷ (r! × (n − r)!)

Permutations with repetition


Combinations with repetition
C(n + r − 1, r) = (n + r − 1)! ÷ (r! × (n − 1)!)

Where:
n = the total number of distinct items available to choose from.
r = the number of items chosen or arranged.
n! = n factorial: n × (n−1) × (n−2) × … × 1 (with 0! defined as 1).
🔀

Order Matters vs Doesn't Matter

Permutations count ABC and BCA separately; combinations treat them as the same selection. This is the single most important distinction to get right.

🔁

With vs Without Repetition

"Without repetition" means each item can be used once; "with repetition" allows the same item to be chosen multiple times, like digits in a PIN.

🔢

Exact BigInt Arithmetic

Factorials grow extremely fast — 20! already exceeds what a standard JavaScript number can represent exactly, so this calculator uses BigInt to keep every digit precise.

⚙️ Why This Formula Works

n! counts all possible orderings of n items. Dividing by (n−r)! "removes" the orderings of the items you didn't choose, leaving exactly the arrangements of the r chosen items — that's nPr. Dividing nPr by r! further removes the internal ordering of the chosen r items, since combinations don't care about their order — that's nCr.

🎯 When to Use Each Formula

  • nPr: arranging people in seats, ranking finishers, ordering tasks
  • nCr: choosing a committee, a lottery ticket, or a hand of cards
  • With repetition: PINs, passwords, or any selection where reuse is allowed

📋 Assumptions

  • n and r must be whole numbers, zero or positive
  • Without repetition, r cannot exceed n
  • All n items are treated as distinguishable from one another

⚠️ Limitations of the Formula

  • n is capped at 1000 in this tool to keep calculations fast
  • Assumes all n items are distinct — repeated identical items require different (multiset) formulas
  • Does not account for additional constraints, like specific items that must or must not be adjacent
Walkthrough

Step-by-Step: How to Use the Permutation & Combination Calculator

From entering n and r to reading every result

Enter Total Items (n)

Type the total number of distinct items available to choose from.

Enter Items Chosen (r)

Type how many items will be selected or arranged from that total.

Click "Calculate"

The calculator computes nPr, nCr, and both with-repetition variants instantly using exact BigInt arithmetic.

Read the nPr and nCr results

nPr counts arrangements where order matters; nCr counts selections where order doesn't matter.

Check the with-repetition variants

Review permutations with repetition (nʳ) and combinations with repetition, used when items can be chosen more than once.

Review the Formulas Used panel

See the exact factorial substitution behind every result to verify the calculation by hand.

Example

Worked Example

The calculator's own default values: n = 10, r = 3

Scenario

You have 10 distinct items and want to choose or arrange 3 of them. We'll compute all four results: nPr, nCr, permutations with repetition, and combinations with repetition.

n (Total Items)10
r (Items Chosen)3
n − r7
Step 1 — Compute nPr: nPr = n! ÷ (n−r)! = 10! ÷ 7! = 10 × 9 × 8 = 720.
Step 2 — Compute nCr: nCr = nPr ÷ r! = 720 ÷ 3! = 720 ÷ 6 = 120.
Step 3 — Compute permutations with repetition: nʳ = 10³ = 1,000.
Step 4 — Compute combinations with repetition: C(n+r−1, r) = C(12, 3) = 12! ÷ (3! × 9!) = 220.
Step 5 — Verify nCr from nPr: notice nCr always equals nPr ÷ r!, since combinations remove the r! internal orderings that permutations count separately — 720 ÷ 6 = 120 checks out.
nPr
720
nCr
120
Perm. w/ Repetition
1,000
Comb. w/ Repetition
220

Explanation: nPr (720) is always ≥ nCr (120) for the same n and r, since every combination of 3 items can be arranged in 3! = 6 different orders (720 ÷ 120 = 6). The with-repetition variants are both larger than their no-repetition counterparts, since allowing reuse always creates more possible outcomes.

Interpretation

Understanding Your Permutation & Combination Result

When to use each of the four results this calculator returns

ResultWhat It AnswersExample Question
nPrHow many ordered arrangements of r items from n exist, no repeatsHow many ways can 3 of 10 runners finish 1st, 2nd, 3rd?
nCrHow many unordered selections of r items from n exist, no repeatsHow many different 3-person committees from 10 people?
Permutations w/ repetition (nʳ)How many ordered sequences of length r exist if items can repeatHow many 3-digit PINs from 10 digits?
Combinations w/ repetitionHow many unordered selections of r items exist if items can repeatHow many ways to pick 3 scoops from 10 ice cream flavors?

Reading the size: for the same n and r, permutations are always greater than or equal to combinations, and with-repetition results are always greater than or equal to without-repetition results — more freedom (order or reuse) always produces at least as many possible outcomes.

Manual verification: confirm nCr = nPr ÷ r! by hand, and confirm nPr = n × (n−1) × … × (n−r+1) (the first r terms of n!) rather than computing the full factorials of large n directly.

Use Cases

Practical Use Cases for the Permutation & Combination Calculator

Where counting arrangements and selections exactly actually matters

🎓

School & college combinatorics

Check homework on nPr, nCr, and factorial-based counting problems step by step.

📝

Competitive exams

Quickly verify permutation and combination answers for entrance and certification tests.

🎲

Probability & combinatorics puzzles

Compute lottery odds, card game probabilities, or dice roll outcomes exactly.

🔐

Password & PIN security analysis

Count possible password or PIN combinations to assess brute-force difficulty.

📅

Scheduling & event planning

Count possible seating arrangements, team lineups, or task orderings.

🧑‍🤝‍🧑

Team & committee selection

Count how many distinct groups of r people can be chosen from n candidates.

🧬

Genetics & research combinatorics

Count arrangements of sequences or combinations of traits in scientific research.

🤖

Data science & ML

Count feature subsets or hyperparameter combinations when designing experiments.

🃏

Card games & gambling odds

Compute exact hand odds in poker, bridge, and other card games using nCr.

🍦

Menu & product configuration

Count possible combinations of toppings, flavors, or product variants, with or without repeats.

🏟️

Sports & tournament scheduling

Count possible match-ups, bracket orders, or finishing-position arrangements.

🔧

Manufacturing & configuration design

Count possible product configurations or assembly-order sequences.

🎈

Everyday counting puzzles

Solve everyday "how many ways" questions, from raffle draws to team jersey numbers.

Pros & Cons

Advantages and Limitations

What this permutation and combination calculator does well, and where care is still needed

✅ Advantages

  • Free, instant, and requires no signup or account
  • Runs entirely in your browser — your inputs are never sent to a server
  • Computes nPr, nCr, and both with-repetition variants from the same n and r
  • Uses exact BigInt arithmetic, so results are never rounded even for very large n
  • Shows the exact formula substitution behind every result
  • Validates inputs and clearly flags invalid cases like r > n
  • Handles n up to 1000 while remaining fast
  • Useful across combinatorics, probability, security, and scheduling problems alike
  • Removes manual factorial arithmetic errors, especially for large n
  • Fast-loading and fully mobile-friendly
  • Free to use as many times as needed, with no calculation limit

⚠️ Limitations

  • Cannot compute results without repetition when r > n
  • n is capped at 1000 to keep calculations fast in the browser
  • Assumes all n items are distinguishable — identical/indistinguishable items need different (multiset) formulas
  • Doesn't handle additional constraints, such as required adjacency or exclusion rules
  • Requires the user to correctly identify whether order matters before choosing nPr vs nCr
  • Large BigInt results can be long numbers that are hard to sanity-check by eye
Reference

Permutation vs Combination vs With/Without Repetition

All four counting modes side by side

ModeOrder Matters?Repetition Allowed?Formula
Permutation (nPr)YesNon! ÷ (n−r)!
Combination (nCr)NoNon! ÷ (r!(n−r)!)
Permutation with repetitionYesYes
Combination with repetitionNoYesC(n+r−1, r)

Common Mistakes and Expert Tips

❌ Common Mistakes

  • Using nPr when the problem actually describes an unordered selection (should be nCr)
  • Using nCr when the problem specifies rank, position, or sequence (should be nPr)
  • Forgetting to switch to a with-repetition formula when items can be reused, like PIN digits
  • Attempting r > n without repetition, which is mathematically invalid
  • Manually computing large factorials with a standard calculator and losing precision
  • Forgetting that 0! = 1, leading to incorrect results at r = 0 or r = n

💡 Expert Tips & Best Practices

  • Ask "does order matter?" first, then "can items repeat?" — the two-question test identifies the right formula every time
  • Pair this tool with the Probability Calculator when you need to turn a count into an actual probability
  • Use the with-repetition permutation formula (nʳ) to estimate password or PIN strength before choosing a length
  • Check the Median & Mode Calculator for the most common outcome when simulating repeated trials
  • Trust BigInt-based results over standard calculator apps for large n, which often round or overflow silently
🔢

Summary: This permutation and combination calculator gives you an instant, free, and exact way to compute nPr, nCr, and their with-repetition variants for any n and r, with the full formula substitution shown. Pair it with related tools like the Probability Calculator and Median & Mode Calculator for a fuller picture of combinatorics and statistics.

FAQ

Frequently Asked Questions

Common questions about permutations and combinations

What is the difference between a permutation and a combination?
A permutation counts arrangements where order matters (AB and BA are different), while a combination counts selections where order doesn't matter (AB and BA are the same). Permutations are always greater than or equal to combinations for the same n and r.
What is the formula for nPr and nCr?
nPr = n! / (n − r)!, the number of ways to arrange r items from n in order. nCr = n! / (r! × (n − r)!), the number of ways to choose r items from n without regard to order.
What does "with repetition" mean?
Permutations or combinations "with repetition" allow the same item to be chosen more than once. Permutations with repetition equal n^r. Combinations with repetition equal C(n + r − 1, r).
Why does this calculator use BigInt?
Factorials grow extremely fast — 20! already exceeds what a standard JavaScript number can represent exactly. Using BigInt keeps every digit exact, even for large values of n.
What does r > n mean, and why is it invalid without repetition?
Without repetition, you cannot choose more items than exist in the pool — if you only have n distinct items, you can't select or arrange more than n of them without repeating one. This calculator blocks any input where r exceeds n and asks you to lower r or raise n. With-repetition modes don't have this restriction, since the same item can be reused.
What is 0!, and why does it equal 1?
By mathematical convention, 0! (zero factorial) equals 1. This makes formulas like nPr = n!/(n−r)! and nCr = n!/(r!(n−r)!) work correctly when r = 0 or r = n, since dividing by 0! must not change the result. Every factorial and combinatorics calculator, including this one, uses this convention.
What happens at r = 0, and why do nPr and nCr both equal 1?
Choosing zero items from any set of n has exactly one outcome: the empty selection. So both nPr and nCr equal 1 when r = 0, regardless of n. This calculator returns 1 for r = 0 automatically.
How many permutations are there of a full set of n items (r = n)?
When r = n, nPr = n! / (n−n)! = n! / 0! = n!. This is simply the number of ways to arrange all n items in a row — for example, 5 items can be arranged in 5! = 120 different orders.
What is the maximum n this calculator supports, and why?
This tool caps n at 1000 to keep factorial calculations fast in the browser. BigInt arithmetic itself can handle much larger numbers exactly, but factorials of numbers above 1000 have thousands of digits and become impractical to compute instantly on every keystroke.
How is permutation and combination used in probability?
Many probability problems reduce to counting favorable outcomes divided by total outcomes, and permutations and combinations are the standard tools for counting both. For example, the probability of a specific 5-card poker hand is 1 divided by C(52,5), since C(52,5) counts all equally likely 5-card hands from a 52-card deck.
What's a real-world example of combinations with repetition?
Choosing 3 scoops of ice cream from 5 flavors, where you're allowed to pick the same flavor more than once and the order you scoop them doesn't matter, is a combination with repetition problem: C(5+3−1, 3) = C(7,3) = 35 possible orders of scoops.
What's a real-world example of permutations with repetition?
Creating a 4-digit PIN where digits 0-9 can repeat and order matters is a permutation-with-repetition problem: 10^4 = 10,000 possible PINs. This is why longer PINs and passwords with repeatable characters are exponentially harder to guess.
How do I calculate password or PIN combinations using this calculator?
Treat the number of possible characters (e.g. 10 digits, 26 letters, or 62 alphanumeric characters) as n, and the password length as r. Use the Permutations with Repetition result (n^r), since password positions matter (order) and characters can repeat. This gives the total number of possible passwords of that length and character set.
Are nPr and nCr always whole numbers?
Yes. Both nPr and nCr count discrete arrangements or selections, so they are always non-negative whole numbers, never fractions or decimals. This calculator uses exact BigInt arithmetic specifically so large results are never rounded or displayed as truncated decimals.
Learn More

Authoritative Resources on Permutations & Combinations

Trusted educational references to go deeper on the math behind this calculator

Related Calculators

Explore other statistics & probability tools