HomeMath › Permutation & Combination

Permutation & Combination Calculator

nPr (Permutations)
n! / (n − r)!
nCr (Combinations)
n! / [r!(n − r)!]
n! (n Factorial)
r! (r Factorial)
Show the math
Enter values to see the worked formula.

What Your Result Means

How This Calculator Works

You enter n (total items) and r (items chosen). The calculator computes n!, r!, and (n−r)! using iterative multiplication, then applies the standard permutation formula nPr = n! / (n−r)! and the combination formula nCr = n! / (r!(n−r)!). It assumes non-negative integers with r ≤ n. Results beyond about 15 significant digits may lose exact integer precision due to JavaScript floating-point limits.

Quick Questions

When should I use permutations vs. combinations?

Use permutations when the arrangement order matters — rankings, seating charts, passwords. Use combinations when order is irrelevant — lottery draws, committee selections, choosing toppings.

Why do large inputs show "Infinity"?

JavaScript uses 64-bit floating-point numbers, which overflow to Infinity around 170!. For values this large, specialized arbitrary-precision libraries are needed.

What does 0! equal and why?

By convention, 0! = 1. This is because there is exactly one way to arrange zero items: do nothing. The convention also keeps the combination and permutation formulas consistent.

Can I use this for lottery odds?

Yes. Most lotteries are combinations — the order the balls are drawn doesn't matter. Enter the total number of balls as n and the number drawn as r, then nCr gives you the number of possible outcomes.

Sources

Method & review

MethodologyHow we calculate this Reviewed & Updated2026-04 Next review2027-04

Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.