Calculators

Permutation & Combination Calculator

Calculate permutations P(n,r) and combinations C(n,r) for n up to 170 with the factorial formulas shown.

Loading interactive tool…

Embed this tool on your site

About this tool

The Permutation & Combination Calculator computes P(n,r) (permutations — ordered arrangements) and C(n,r) (combinations — unordered selections) for whole numbers n (total items) and r (items chosen). Both results appear side by side as you type, together with the formulas filled in with your numbers: P(n,r) = n! / (n-r)! and C(n,r) = n! / (r! × (n-r)!), plus a reminder that C(n,r) = P(n,r) / r!. Factorials are computed with JavaScript BigInt, so results are exact for n up to 170; very long results are shortened to their leading digits and a power of ten. This is a core tool for probability, statistics, combinatorics coursework, and counting problems in fields such as genetics, games, and cryptography. The factorial-based formulas P(n,r) and C(n,r) are foundational across discrete math, probability theory, statistical mechanics, and computer science (e.g., counting paths in graphs).

Why use it

  • Calculates both permutations and combinations simultaneously.

  • Shows the factorial formulas with your numbers filled in so students can follow the method.

  • Uses BigInt for exact integer results with no floating-point rounding.

  • Instant results with no form submission needed.

  • Flags impossible inputs such as r greater than n instead of returning a misleading number.

  • Privacy-first: input numbers never leave your browser; calculations are pure JavaScript.

How to use

  1. Enter the total number of items (n), up to 170.
  2. Enter the number of items to choose (r).
  3. Both P(n,r) and C(n,r) are calculated instantly as you type.
  4. Read the formulas panel to see each result written out as n! / (n−r)! and n! / (r! × (n−r)!).
  5. Compare the two results — P(n,r) is always C(n,r) multiplied by r!.
  6. Verify edge cases by entering r = 0 (both are 1) or r = n (P returns n!, C returns 1).

When it helps

  • Solving probability problems involving ordered or unordered selections.
  • Combinatorics homework involving factorial calculations.
  • Calculating lottery odds or game probability scenarios.
  • Verifying hand calculations in statistics and probability coursework.
  • Deriving probability fractions for card games, dice rolls, or other combinatorial setups.
  • Estimating arrangements in genetics, cryptography, or scheduling problems.

Examples

P(10, 3) — picking gold/silver/bronze from 10 athletes

Input

n = 10, r = 3

Expected result

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

C(52, 5) — five-card poker hands from a deck

Input

n = 52, r = 5

Expected result

C(52,5) = 52!/(5!×47!) = 2,598,960

C(49, 6) — UK lottery odds (1 in C(49,6))

Input

n = 49, r = 6

Expected result

C(49,6) = 13,983,816 (odds 1 in ~14 million)

Tips

  • Use combinations C(n,r) when order does not matter (e.g., lottery, picking team members, hand of cards) and permutations P(n,r) when it does (e.g., podium finishes, password arrangements).
  • Cancel the larger factorial in the numerator and denominator before multiplying — for P(50,3) compute 50×49×48 directly, not 50!.
  • Pascal's triangle gives all C(n,r) values for small n quickly: each entry is the sum of the two above it, with the rows being C(n,0), C(n,1)... C(n,n).
  • C(n,r) = C(n,n-r) — choosing 7 from 10 is the same count as choosing 3 from 10. Use the smaller r to simplify by hand.
  • P(n,r) = r! × C(n,r) — if you know the combination, multiplying by r! gives you the corresponding permutation count.
  • For probability problems, divide favorable arrangements by total arrangements — both numerator and denominator are usually permutations or combinations.

Frequently Asked Questions

What is the difference between permutation and combination?
A permutation counts arrangements where order matters (ABC ≠ BAC). A combination counts selections where order does not matter (ABC = BAC = CAB). C(n,r) = P(n,r) / r!
What does P(5,3) mean?
P(5,3) is the number of ordered arrangements of 3 items chosen from 5 distinct items. P(5,3) = 5!/2! = 60.
What does C(5,3) mean?
C(5,3) is the number of unordered groups of 3 items chosen from 5 distinct items. C(5,3) = 5!/(3!×2!) = 10.
What is n! (factorial)?
n! is the product of all positive integers up to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120. By convention, 0! = 1.
Can r be greater than n?
No. You cannot choose more items than exist, so the calculator marks both results as invalid and shows 'r cannot be greater than n.'
How does this compare to a graphing calculator (TI-84) or Wolfram Alpha?
The math is identical — same factorial formulas. This tool shows both results at once with the formulas written out using your numbers. For symbolic algebra (n choose 2k+1 simplifications), use Wolfram Alpha; for quick numerical answers, this is faster.
What happens for very large n?
The calculator accepts n up to 170 and computes exact BigInt results. Results longer than 20 digits are displayed as their first six digits followed by a power of ten, e.g. 170! shown in shortened form.
How do I use this for poker probability?
Total 5-card hands = C(52,5) = 2,598,960. Royal flush count = 4 (one per suit). Probability = 4/2,598,960 ≈ 1 in 649,740. Most poker probabilities are ratios of two C(n,r) values.

Explore the category

Glossary

Permutation
An ordered arrangement of items. P(n,r) = n! / (n-r)! counts the ways to arrange r items chosen from n distinct items.
Combination
An unordered selection of items. C(n,r) = n! / (r! × (n-r)!) counts the ways to choose r items from n without regard to order.
Factorial (n!)
Product of all positive integers up to n. 5! = 5×4×3×2×1 = 120. By convention, 0! = 1.
Pascal's triangle
A triangular array where each entry is C(n,r); each row sums to 2^n and adjacent entries follow C(n,r) = C(n-1,r-1) + C(n-1,r).
Binomial coefficient
Another name for C(n,r), often written (n over r) or ⁿCᵣ. Coefficient of x^r in the expansion of (1+x)^n.
Sample space
The set of all possible outcomes of a probability experiment; counted using permutations or combinations depending on whether order matters.
With repetition
When an item can be chosen multiple times. P with repetition = n^r; C with repetition = C(n+r-1, r).
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities