Permutation & Combination Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Understanding Permutations and Combinations

Permutations and combinations are core tools in counting and probability. They answer questions like:

  • How many different 4-digit PINs can be formed?
  • In how many ways can 6 lottery numbers be chosen from 49?
  • How many possible 5-card poker hands exist in a standard deck?

This calculator lets you enter the total number of items n and the number of items chosen r. It then computes both the permutations and combinations for those values, so you can quickly compare “order matters” versus “order does not matter” scenarios.

Key Definitions

Before using the formulas, it helps to clarify a few basic terms.

Total items (n)

n is the size of the full set you are choosing from. Examples:

  • 10 students in a class: n = 10
  • 52 cards in a standard deck: n = 52
  • 26 letters of the English alphabet: n = 26

Items chosen (r)

r is how many items you take from the set at once.

  • Creating a 3-person committee from 10 people: r = 3
  • Choosing 5 lottery numbers from 49: r = 5
  • Drawing a 5-card hand from 52 cards: r = 5

Factorials

Both permutations and combinations rely on the factorial function. For any non-negative integer n, the factorial of n, written n!, is:

n! = k = 1 n ( k )

In plain language, you multiply all positive whole numbers from 1 up to n. For example:

  • 1! = 1
  • 3! = 1 × 2 × 3 = 6
  • 5! = 1 × 2 × 3 × 4 × 5 = 120

By convention, 0! = 1.

Permutation Formula (Order Matters)

A permutation counts how many different ordered arrangements you can form when selecting r items from n without repetition. Changing the order produces a different permutation.

The number of permutations is written as P(n, r) and defined by:

P ( n , r ) = n! ( n r ) !

Plain text version: P(n, r) = n! / (n − r)!

Use permutations when:

  • You care about order (1-2-3 is different from 3-2-1).
  • You do not reuse items (no repetition).

Combination Formula (Order Does Not Matter)

A combination counts how many different groups of size r you can form from n items when order does not matter. The group {A, B, C} is the same as {C, B, A}.

The number of combinations is written as C(n, r) or nCr and defined by:

C ( n , r ) = n! r! ( n r ) !

Plain text version: C(n, r) = n! / [r! × (n − r)!].

Use combinations when:

  • Order does not matter (1-2-3 is the same group as 3-2-1).
  • You do not reuse items (no repetition).

Permutations vs. Combinations at a Glance

The following table summarizes the main differences and gives quick examples so you can decide which one to use.

Aspect Permutations P(n, r) Combinations C(n, r)
Does order matter? Yes, different orders count as different outcomes. No, different orders are treated as the same group.
Typical notation P(n, r) or nPr C(n, r), nCr, or (nr)
Formula P(n, r) = n! / (n − r)! C(n, r) = n! / [r! (n − r)!]
Example scenario Arranging 3 winners as gold, silver, bronze from 10 runners. Choosing 3 people from 10 to form a committee.
Result size Always greater than or equal to C(n, r) for the same n, r (when r > 1). Always less than or equal to P(n, r) for the same n, r (when r > 1).
Relationship P(n, r) = C(n, r) × r! C(n, r) = P(n, r) / r!

Worked Examples

Example 1: Committee vs. Officer Roles

Question: A club has 10 members.

  • How many ways can you choose 3 members to form a committee (no roles)?
  • How many ways can you choose a president, vice president, and secretary (distinct roles)?

Here, n = 10 and r = 3.

Committee (order does not matter): use combinations.

C(10, 3) = 10! / [3! × (10 − 3)!] = 10! / (3! × 7!)

Compute step by step:

  • 10! / 7! = 10 × 9 × 8
  • 3! = 3 × 2 × 1 = 6
  • C(10, 3) = (10 × 9 × 8) / 6 = 720 / 6 = 120

Officer roles (order matters): use permutations.

P(10, 3) = 10! / (10 − 3)! = 10! / 7! = 10 × 9 × 8 = 720

So there are 120 possible committees but 720 ways to assign three distinct officer roles.

Example 2: Lottery Numbers

Question: A lottery asks you to choose 6 distinct numbers from 49, and the drawn numbers are not ordered. How many different tickets are possible?

Here, n = 49 and r = 6. Order does not matter, so we use combinations:

C(49, 6) = 49! / [6! × 43!]

Writing out all factorials is impractical by hand, but the calculator evaluates this quickly, giving:

C(49, 6) = 13,983,816 possible tickets.

This huge number illustrates why winning the jackpot with one ticket is very unlikely.

Example 3: Simple Passwords

Question: You create a 3-letter password using distinct uppercase letters (A–Z). How many possibilities are there if order matters?

There are n = 26 letters, and you use r = 3 distinct letters in each password. Order clearly matters (“ABC” is different from “CBA”), so use permutations:

P(26, 3) = 26! / (26 − 3)! = 26! / 23! = 26 × 25 × 24

Compute:

  • 26 × 25 = 650
  • 650 × 24 = 15,600

So there are 15,600 possible 3-letter passwords under these assumptions.

How to Use the Calculator

  1. In the field labeled Total items (n), enter the size of your full set (for example, 10 students, 49 lottery numbers, 52 cards).
  2. In the field labeled Items chosen (r), enter how many items you select at a time.
  3. Submit the form to see:
  • The number of permutations P(n, r), where order matters.
  • The number of combinations C(n, r), where order does not matter.

You can adjust n and r as often as you like to compare different scenarios.

Interpreting the Results

When you run the calculator, you typically get two large integers:

  • P(n, r) (permutations) — the count of ordered arrangements.
  • C(n, r) (combinations) — the count of unique unordered groups.

Some practical interpretations:

  • If you are modeling lotteries, card hands, or subsets where the listing order has no effect, focus on C(n, r).
  • If you are modeling passwords, race rankings, seat assignments, or schedules where order clearly changes the outcome, focus on P(n, r).
  • If P(n, r) is extremely large, it signals that enumerating every outcome is impossible and probability calculations must rely on formulas or approximations.

Limitations and Assumptions

This calculator is designed for the standard, no-repetition versions of permutations and combinations. It makes the following assumptions:

  • Non-negative integers: n and r are whole numbers (0, 1, 2, …). Negative or non-integer values are not valid in these formulas.
  • r ≤ n: You cannot choose more items than exist in the set. If r > n, P(n, r) and C(n, r) are defined as 0 in many contexts.
  • No repetition: Once an item is chosen, it is not used again in the same selection (sampling without replacement).
  • Standard factorials: Calculations are based on ordinary factorials n! with 0! = 1.
  • Large numbers: For large n and r, factorials grow extremely quickly. Depending on implementation and your device, results may be shown in scientific notation or may reach the limits of numeric precision.

There are also related counting formulas for cases with repetition (for example, allowing the same letter to appear more than once in a code). Those are not covered by the basic P(n, r) and C(n, r) formulas used here.

Privacy and Local Computation

All calculations are performed directly in your browser using client-side code. The values you enter for n and r are not sent to a server for processing. This keeps your usage private and ensures that results appear instantly, even if you are offline after loading the page.

Related Topics

To go deeper into discrete mathematics and probability, you may also find these concepts and tools helpful:

  • Factorials and properties of n! (including approximations like Stirling’s formula for large n).
  • Basic probability rules (sample spaces, events, and conditional probability).
  • Binomial coefficients and the binomial distribution, which also rely on C(n, r).
  • Dedicated tools such as a factorial calculator or probability calculator for more complex problems.

Together, permutations and combinations give you a compact language for reasoning about large, complex sets of possibilities without having to list them all individually.

Embed this calculator

Copy and paste the HTML below to add the Permutation and Combination Calculator - Count Possible Arrangements to your website.