Combinations & Permutations Calculator
Compute nCr and nPr, with and without repetition, plus factorials — exact arbitrary-precision integers for probability, lottery odds and combinatorics.
n! / (r! · (n−r)!)
10
Order doesn't matter
n! / (n−r)!
20
Order matters
(n+r−1)! / (r! · (n−1)!)
15
Repeats allowed, order ignored
nʳ
25
Repeats allowed, order matters (nʳ)
n!
120
r!
2
(n−r)!
6
Values are capped at 10,000 to stay instant. All math is exact (arbitrary precision).
How to use
- Enter n — the total number of items to choose from.
- Enter r — how many you pick.
- Read off combinations (order ignored) and permutations (order matters), plus the repetition variants and factorials. Copy any exact value.
About this tool
ShowHide
Four counting questions from the same two numbers. Combinations count selections where order does not matter, permutations count arrangements where it does, and each has a variant that allows the same item to be chosen more than once. Enter n and r and all four answers appear together, which is usually faster than deciding in advance which one your problem is — seeing that the ordered count is larger by a factor of r! often settles the question by itself.
The distinction is easiest to feel on a deck of cards. Choosing 5 cards from 52 gives 2,598,960 possible hands, because a hand is a set and the order you were dealt it in is irrelevant. Dealing 5 cards from 52 into five named positions gives 311,875,200 — exactly 120 times more, which is 5!, the number of ways to shuffle any one hand into an order. A 6-from-49 lottery is the same calculation at 13,983,816, which is the honest way to read the odds printed on a ticket.
The arithmetic runs in arbitrary-precision integers rather than floating point, and that is not a detail. JavaScript numbers hold integers exactly only up to 2^53, and factorials pass that at 19!; the next few still happen to be stored exactly, but from 23! on they are rounded. A calculator that works in doubles starts returning wrong digits there, goes visibly wrong well before it errors, and gives up entirely past 170!, which is the last one that fits in a double at all. Here C(100, 50) comes back as its full thirty-digit value, 100891344545564193334812497256, with every digit correct.
What the tool cannot do is decide which model fits your problem, and that is where counting goes wrong far more often than in the arithmetic. Ask whether swapping two chosen items gives a genuinely different outcome — if yes you want permutations — and whether the same item can appear twice, which is the difference between drawing without replacement and with it. Problems with constraints ("at least one of each", "no two adjacent") are not a single binomial coefficient at all; they need inclusion-exclusion or a recurrence, and plugging them into n and r produces a number that looks authoritative and is not an answer to your question.
Frequently asked questions
What is the difference between a combination and a permutation?
Order. A combination counts selections where order does not matter (e.g. a lottery draw); a permutation counts arrangements where order matters (e.g. a podium of 1st/2nd/3rd).
When do I use the with-repetition versions?
When the same item can be picked more than once — like a 4-digit PIN (permutations with repetition, 10⁴) or scoops of ice cream where flavours can repeat (combinations with repetition).
Are the big numbers exact?
Yes. Everything uses arbitrary-precision integers, so values with hundreds of digits stay exact instead of being rounded to floating point.
Why is there a maximum of 10,000?
It keeps the calculation instant in your browser. Larger factorials grow to hundreds of thousands of digits and would slow the page down.
Related tools
Probability Distribution Calculator
Probabilities and quantiles for the normal, t, chi-square, F, exponential, binomial and Poisson distributions, accurate far into the tails.
Math & Statistics
Prime Factorization · GCD · LCM
Factor an integer into primes, list all divisors, and compute GCD and LCM of two numbers. Handles values up to ~10¹².
Math & Statistics
Right Triangle Calculator
Solve a right triangle from any two sides — get the third side, both acute angles, area and perimeter using the Pythagorean theorem.
Math & Statistics
Slope & Line Calculator
From two points, get the slope, the line equation y = mx + b, the distance, midpoint, angle of inclination, and rise/run.
Math & Statistics
Rule of Three Calculator
Solve a proportion a/b = c/d — enter any three values, leave one field empty, and the fourth is found by cross-multiplication.
Math & Statistics
Quadratic Equation Solver
Solve ax² + bx + c = 0 with the quadratic formula — real or complex roots, plus discriminant, vertex, axis of symmetry and sum/product of roots.
Math & Statistics