Skip to content
AZ Tools

Combinations & Permutations Calculator

Compute nCr and nPr, with and without repetition, plus factorials — exact arbitrary-precision integers for probability, lottery odds and combinatorics.

Combinations (nCr)

n! / (r! · (n−r)!)

10

Order doesn't matter

Permutations (nPr)

n! / (n−r)!

20

Order matters

Combinations with repetition

(n+r−1)! / (r! · (n−1)!)

15

Repeats allowed, order ignored

Permutations with repetition

nʳ

25

Repeats allowed, order matters (nʳ)

Factorials
n!

n!

120

r!

r!

2

(n − r)!

(n−r)!

6

Values are capped at 10,000 to stay instant. All math is exact (arbitrary precision).

How to use

  1. Enter n — the total number of items to choose from.
  2. Enter r — how many you pick.
  3. Read off combinations (order ignored) and permutations (order matters), plus the repetition variants and factorials. Copy any exact value.

About this tool

Show

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