ToolJutsu
All tools
Calculator Tools

Permutation & Combination Calculator

Calculate permutations (nPr) and combinations (nCr).

Choose r items from n. Permutations count ordered selections, combinations count unordered ones.

Permutations (nPr)

720

Combinations (nCr)

120

nPr = n! ÷ (n−r)! and nCr = n! ÷ (r! · (n−r)!). Computed exactly with BigInt.

QuantityValue
n!3,628,800
r!6
(n − r)!5,040
Permutations with repetition (nʳ)1,000
Combinations with repetition C(n+r−1, r)220

Formulas

  • Permutations: nPr = n! ÷ (n − r)!
  • Combinations: nCr = n! ÷ (r! · (n − r)!)
  • Permutations with repetition: nʳ
  • Combinations with repetition: C(n + r − 1, r)
Processed on your device. We never see your files.

How to use Permutation & Combination Calculator

What this calculator does

This tool computes permutations (nPr) and combinations (nCr) — the two fundamental counting quantities from combinatorics. You enter the total number of items, n, and the number you are choosing, r, and the calculator returns both counts exactly. It also shows the supporting factorials (n!, r!, and (n − r)!) and the with-repetition variants, n to the power r for ordered selections and C(n + r − 1, r) for unordered ones. Because the numbers involved grow enormous very quickly, all the arithmetic uses BigInt for exact, full-digit results, and everything runs locally in your browser.

Why you might need it

Counting problems are the backbone of probability, statistics, and discrete maths. How many ways can you arrange a playlist of 12 songs? How many five-card poker hands exist? How many lottery tickets cover every combination? How many unique passwords of a given length are possible? Each of these is a permutation or combination calculation. Students need a dependable check for combinatorics homework, and anyone reasoning about probability needs accurate counts of favourable and total outcomes. A calculator that stays exact even when the numbers run to dozens of digits removes a real source of error.

How to use it

  1. Enter n, the total number of distinct items available.
  2. Enter r, how many of them you are selecting or arranging.
  3. Read nPr and nCr in the result card — they update as you type.
  4. Check the breakdown table for the factorials and the with-repetition variants, use the copy button for the headline result, and Reset to return to the example.

How it’s calculated

A permutation counts ordered selections. The formula is nPr = n! ÷ (n − r)!. The calculator evaluates it as a falling product, n × (n − 1) × … × (n − r + 1), which avoids building the full factorial and keeps the work small.

A combination counts unordered selections, so it divides out the r! ways each selection could have been ordered: nCr = n! ÷ (r! × (n − r)!), computed here as nPr ÷ r!. By definition nC0 and nCn both equal 1.

The with-repetition counts use different formulas. Ordered selections with repetition number , since every one of the r positions independently has n choices. Unordered selections with repetition — multisets — number C(n + r − 1, r), the “stars and bars” result. Every value is computed with BigInt so even large factorials are exact.

Common pitfalls

The most common error is choosing the wrong tool: if order matters use permutations, if it does not use combinations. A lottery draw is a combination; a race finishing order is a permutation. Another pitfall is forgetting that nPr and nCr assume no item is reused — for selections that allow repeats you need the with-repetition variants. People also try r greater than n, which has no valid count. Finally, beware ordinary calculators that overflow on large factorials and quietly return rounded or “infinity” results; exact counting needs exact arithmetic.

A quick relationship worth knowing: nPr = nCr × r!, so permutations are just combinations multiplied by the number of orderings. Combinations are also symmetric — nCr equals nC(n − r) — so choosing what to leave out is the same as choosing what to take. Once you have a count of favourable and total outcomes from this calculator, a probability calculator can turn them into a probability. Because all the maths runs on your device with exact BigInt arithmetic, you can explore large counting problems freely and nothing you enter ever leaves the browser.

Frequently asked questions

What is the difference between a permutation and a combination?
A permutation counts arrangements where order matters, and a combination counts selections where order does not. Picking a president and a vice-president from a group is a permutation, because swapping the two roles gives a different result. Picking a two-person committee is a combination, because the same two people form the same committee regardless of order. That is why nPr is always greater than or equal to nCr.
Why does the calculator use BigInt?
Factorials grow extremely fast — 21! already exceeds the largest integer a normal JavaScript number can represent exactly. Beyond that point ordinary arithmetic silently loses precision. BigInt stores arbitrarily large whole numbers exactly, so nPr, nCr, and the factorials shown here are correct digit for digit, not rounded approximations.
What do 'with repetition' results mean?
The standard nPr and nCr assume each item is used at most once. The with-repetition variants allow items to be reused. Permutations with repetition is nʳ — for each of the r positions you may pick any of the n items again. Combinations with repetition, C(n + r − 1, r), counts multisets, such as how many ways to choose r scoops from n ice-cream flavours when flavours can repeat.
What values of n and r are allowed?
Both must be whole numbers, and r must be between 0 and n inclusive. If r exceeds n the calculator reports that no such selection exists. Very large values of n are capped so the page stays responsive, but the cap is well above any realistic counting problem.
Is anything I enter sent to a server?
No. Every factorial and counting formula runs in JavaScript inside your browser. The values of n and r you type are never uploaded or stored, and they disappear when you close the tab.

Related tools