Everyday tool

Combinations and Permutations Calculator

Enter the total items and how many are selected. Choose whether order matters.

Runs in your browser. No upload.

Values are processed locally in this browser.

Result

—

About this tool

Combinations and Permutations Calculator made simple.

Counts are limited to exact JavaScript-safe integer inputs and finite numeric output. This calculator does not enumerate every arrangement.

Guide

Using Combinations and Permutations Calculator

The Combinations and Permutations Calculator counts how many ways you can pick r items out of n. Choose combination when the order of the picks does not matter, or permutation when it does. The answer is an exact whole number, even with dozens of digits, and long results also show their digit count and a short scientific form. It counts the ways; it does not list them.

How to use it

  1. Type n, the total number of items to choose from, and r, how many you pick. Both must be whole numbers with 0 ≤ r ≤ n, and n can be up to 100,000.
  2. Choose the selection type: Combination (order does not matter) or Permutation (order matters).
  3. Press Calculate. The result gives the count and a line saying whether order matters. When the count has more than 15 digits, an extra line shows the digit count and an approximate form.
  4. Press Copy result to copy the text, or Clear to empty the boxes.

Worked examples

Pick 2 of 5, order ignored

You enter
N
5
R
2
Type
combination
You get
Result
Combinations: 10 Order does not matter.

With the letters A to E, the pairs are AB, AC, AD, AE, BC, BD, BE, CD, CE and DE. AB and BA count as the same pair.

Run through the tool’s own code.

Pick 2 of 5, order counts

You enter
N
5
R
2
Type
permutation
You get
Result
Permutations: 20 Order matters.

Now AB and BA are different, so every pair counts twice. That is 10 combinations times 2, which is 20.

Run through the tool’s own code.

A five-card hand

You enter
N
52
R
5
Type
combination
You get
Result
Combinations: 2598960 Order does not matter.

This is the number of different five-card hands from a standard 52-card deck. The result is shown without commas between the digits.

Run through the tool’s own code.

A very large count

You enter
N
100
R
50
Type
combination
You get
Result
Combinations: 100891344545564193334812497256 Digits: 30 (≈ 1.0089 × 10^29) Order does not matter.

The full number is printed with no rounding. Because it has more than 15 digits, a Digits line adds the length and a short form.

Run through the tool’s own code.

r larger than n

You enter
N
5
R
7
Type
combination
You get
Message
Use whole numbers with 0 ≤ r ≤ n ≤ 100,000 (exact big-integer results; larger values would take too long in a browser tab).

You cannot pick 7 different items out of 5. Decimals, negative numbers and an n above 100,000 show the same message.

Run through the tool’s own code.

When it helps

  • Count lottery-style picks, card hands or team selections where order does not matter.
  • Count ordered outcomes, such as how many ways 3 runners can finish first, second and third out of 10, which is 720.
  • Check homework answers for nCr and nPr problems in probability.
  • See how fast counts grow, such as the 30-digit answer for choosing 50 out of 100.

Limits to keep in mind

  • Whole numbers only, with 0 ≤ r ≤ n and n no larger than 100,000. Each item can be picked once at most: repeated picks and identical items are not covered.
  • It gives the count and not the list, so it does not show which groups or orders exist.
  • Big answers are printed in full. Permutations of 100,000 out of 100,000 have 456,574 digits and took a couple of seconds to work out in a test, and such a number fills the result box.
  • The Digits line appears only above 15 digits, and its short form cuts the leading digits instead of rounding them.

Tips

  • Ask the order question first: does picking A then B differ from picking B then A? If yes, use permutation. If no, use combination.
  • Run both modes for the same n and r. The permutation count equals the combination count times r factorial.
  • Check a small case by hand, such as 5 choose 2 equal to 10, before you trust a big result.

Sources

Common questions

About Combinations and Permutations Calculator.

What is the difference between a combination and a permutation?

A combination ignores order, so choosing A then B is the same as B then A. A permutation counts order, so those are two different results. For the same n and r, permutations are always the larger or equal count.

How are the two counts worked out?

Combinations are n! divided by r! times (n - r)!, and permutations are n! divided by (n - r)!. The tool multiplies only the needed terms in whole-number maths, so it never builds the full factorial.

What does n choose 0 give?

One. There is exactly one way to pick nothing at all. The same goes for picking all n items in a combination, which also gives one.

How large can n be?

Up to 100,000. Beyond that the tool shows a range message, since the sum would take too long in a browser tab. Within the limit the result is an exact whole number with no rounding.

Can I count picks where an item can repeat?

Not with this tool. Each item is used once at most. Counts with repeats need other formulas, such as n to the power r for ordered picks with repeats.

Why do some answers have a Digits line?

When the exact number has more than 15 digits, it is hard to read at a glance. The extra line gives the digit count and the first digits in scientific form, such as 1.0089 × 10^29.

Is anything I type uploaded?

No. The counting is done on your device inside the browser tab, and your numbers are not sent away.

How do I use Combinations calculator?

Enter the total items and how many are selected. Choose whether order matters.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.