Permutation & combination calculator

nPr (arrangements), nCr (selections) and n! (factorial) for any non-negative integers. Handles large n via log-gamma to avoid overflow.

nPr / nCr inputs

nPr (Permutation)
720
nCr (Combination)
120
n!
3,628,800
r!
6
(n − r)!
5,040
nPr formula
n! ÷ (n−r)!
nCr formula
n! ÷ [r! × (n−r)!]

When to use each

  • Permutation (nPr) — order matters: medals in a race, 4-letter passwords, seat arrangements.
  • Combination (nCr) — order doesn't matter: lottery numbers, committee picks, card hands.
  • Factorial (n!) — total arrangements of n distinct items (= nPn).

Worked examples

QuestionAnswer
How many 3-medal podiums from 10 runners?10P3 = 720
How many 3-person committees from 10 people?10C3 = 120
How many 5-card poker hands from a 52-card deck?52C5 = 2,598,960
How many ways to arrange 7 books on a shelf?7! = 5,040

FAQ

Are repetitions counted?

No. nPr and nCr both assume each item is selected at most once (sampling without replacement). For sampling with replacement, the formulas are n^r and (n+r−1)Cr respectively.

Is 0! = 1?

Yes — by convention. It comes from the recursion n! = n × (n−1)! and from the gamma function definition Γ(1) = 1.

Related calculators