Factorial Calculator
Exact n! with steps and every digit, plus digit count, trailing zeros, n!! and Stirling’s approximation.
This permutation calculator finds nPr, the number of ordered arrangements , and works as an nCr calculator for unordered selections .
Permutations P(10, 3)
720
Exact value
There are 720 ways to arrange 3 of 10 items when order matters (permutations) and 120 ways to choose them when it does not (combinations), because each group of 3 can be put in 3! different orders.
| r | Permutations P(n, r) | Combinations C(n, r) |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 10 | 10 |
| 2 | 90 | 45 |
| 3 | 720 | 120 |
| 4 | 5,040 | 210 |
| 5 | 30,240 | 252 |
| 6 | 151,200 | 210 |
| 7 | 604,800 | 120 |
| 8 | 1,814,400 | 45 |
| 9 | 3,628,800 | 10 |
| 10 | 3,628,800 | 1 |
Permutations (order matters)
Multiply the 3 largest whole numbers from 10 downward.
Combinations (order does not matter)
Divide the ordered arrangements by the r! orders of each group.
Circular arrangements
Turning a circle of 3 seats gives 3 rotations of the same arrangement, so divide P(10, 3) by 3.
Combinations with repetition
Count the ways to place r identical stars among n − 1 bars (stars and bars).
Permutations with repetition
Each of the 3 positions can be any of the 10 items.
It also counts circular arrangements and both cases with repetition, shows the steps, and keeps every digit of huge results.
Permutations (nPr)
Plain-text formula: P(n, r) = (n!)/((n − r)!) = n(n − 1)⋯(n − r + 1)
Ordered arrangements of r different items from n. The calculator multiplies the r factors with exact integer (BigInt) arithmetic, so the result is never rounded.
Combinations (nCr)
Plain-text formula: (C(n, r)) = (n!)/(r! (n − r)!) = (P(n, r))/(r!)
Unordered selections of r different items from n. Every combination corresponds to r! permutations, so dividing P(n, r) by r! removes the orderings.
Circular arrangements
Plain-text formula: (P(n, r))/r, (n − 1)!;when r = n
Seats around a round table have no first seat, so the r rotations of one seating count once.
With repetition
Plain-text formula: n^r;(ordered), (C(n + r − 1, r));(unordered)
If items can be reused, ordered sequences have n choices for each of the r positions, and unordered selections are counted by "stars and bars".
The answer counts outcomes, not probabilities. To get the chance of one particular outcome when all are equally likely, divide 1 by the count: one lottery ticket out of 13,983,816 has a probability of about 7.15 × 10⁻⁸. To draw a set of numbers without repeats, use the random number generator.
Choosing the wrong formula is the most common mistake. Ask two questions: does the order of the chosen items create a different outcome, and can the same item appear twice? The table under "Which formula should I use?" maps each answer to its count.
Counts grow very fast. C(1000, 500) already has 300 digits; the calculator writes out every digit up to 5,000 digits and gives scientific notation beyond that.
Order matters when rearranging the same items gives a different result. Gold, silver and bronze for runners A, B and C is a different podium from C, B, A, so podiums are permutations: P(8, 3) = 8 × 7 × 6 = 336 for eight runners.
Order does not matter when only membership counts. A committee of A, B and C is the same committee as C, B, A, so committees are combinations: C(8, 3) = 56. Dividing 336 by the 3! = 6 orderings of each group gives the same 56.
| Situation | Order matters? | Repeats? | Formula | Example |
|---|---|---|---|---|
| Permutation (nPr) | Yes | No | n!/(n − r)! | Podium of 3 from 8 runners: 336 |
| Combination (nCr) | No | No | n!/(r!(n − r)!) | Committee of 3 from 8 people: 56 |
| Circular arrangement | Yes, up to rotation | No | P(n, r)/r | 8 guests at a round table: 7! = 5,040 |
| Permutation with repetition | Yes | Yes | nʳ | 3-letter codes from 8 letters: 512 |
| Combination with repetition | No | Yes | (n + r − 1)!/(r!(n − 1)!) | 3 scoops from 8 flavors: 120 |
| Arrangement with identical items | Yes | Some items identical | n!/(k₁! · k₂! · …) | Letters of MISSISSIPPI: 34,650 |
Permutations (nPr): start at n and multiply r numbers, counting down by 1. For 5P2, multiply 5 × 4 = 20. You never need the full factorials, because (n − r)! cancels.
Combinations (nCr): work out nPr, then divide by r!. For 5C2, 20 ÷ 2! = 10, so there are 10 ways to pick 2 items from 5. If r is more than half of n, use n − r instead: C(10, 8) = C(10, 2) = 45.
Items that repeat inside the list: to arrange letters or objects where some are identical, divide n! by the factorial of each group size. MISSISSIPPI has 11 letters (4 I, 4 S, 2 P, 1 M), so it has 11!/(4! · 4! · 2! · 1!) = 34,650 distinct arrangements. Enter n = 11 and the group sizes 4, 4, 2, 1 under More options to see the working.
| n | nP2 | nC2 | nP3 | nC3 | nP5 | nC5 |
|---|---|---|---|---|---|---|
| 5 | 20 | 10 | 60 | 10 | 120 | 1 |
| 6 | 30 | 15 | 120 | 20 | 720 | 6 |
| 8 | 56 | 28 | 336 | 56 | 6,720 | 56 |
| 10 | 90 | 45 | 720 | 120 | 30,240 | 252 |
| 12 | 132 | 66 | 1,320 | 220 | 95,040 | 792 |
| 20 | 380 | 190 | 6,840 | 1,140 | 1,860,480 | 15,504 |
| 52 | 2,652 | 1,326 | 132,600 | 22,100 | 311,875,200 | 2,598,960 |
TI-84 Plus: type n, press MATH, move right to PRB, choose 2:nPr or 3:nCr, then type r and press ENTER. Casio fx-991EX and similar models: type n, press SHIFT then × for nPr or SHIFT then ÷ for nCr, then type r.
Excel and Google Sheets: =PERMUT(n, r) gives nPr, =COMBIN(n, r) gives nCr, =PERMUTATIONA(n, r) gives nʳ and =COMBINA(n, r) gives combinations with repetition. Spreadsheets use floating-point numbers, so results above about 15 significant digits are rounded.
Python 3.8 and later: math.perm(n, r) and math.comb(n, r) return exact integers of any size, the same values this calculator shows.
How many different tickets are there when 6 numbers are drawn from 1 to 49 and the order of the draw does not matter?
Answer: There are 13,983,816 possible tickets, so a single ticket wins with probability 1 in 13,983,816 (about 7.15 × 10⁻⁸). If the order mattered, there would be P(49, 6) = 10,068,347,520 sequences.
A permutation is an arrangement where order matters (a race result); a combination is a selection where it does not (a hand of cards). For the same n and r, there are r! times as many permutations as combinations.
nPr is the number of permutations of n items taken r at a time, n!/(n − r)!. nCr is the number of combinations of n items taken r at a time, n!/(r!(n − r)!), also written C(n, r) or "n choose r".
There are 10. C(5, 2) = (5 × 4)/(2 × 1) = 10. If the order of the two matters, there are P(5, 2) = 20.
Characters can repeat and order matters, so use nʳ. A 4-digit PIN has 10⁴ = 10,000 options, and an 8-character password of lowercase letters has 26⁸ = 208,827,064,576.
0! is defined as 1, the value of an empty product. There is exactly one way to choose nothing, so C(n, 0) = 1 and P(n, 0) = 1.
Without repetition there is no way to choose more distinct items than exist, so P(n, r) and C(n, r) are 0. With repetition, r can exceed n: 3 scoops from 2 flavors gives C(4, 3) = 4 unordered choices.
n and r can go up to one billion. Results with up to 5,000 digits are computed exactly; larger ones are shown in scientific notation with their approximate digit count.
Exact n! with steps and every digit, plus digit count, trailing zeros, n!! and Stirling’s approximation.
Exact and cumulative binomial probabilities for up to a million trials, with steps, a table and a graph.
Mean, median, mode, five-number summary, IQR, outliers and SD with steps, a histogram and a box plot.
Type or tap expressions with exact fractions, memory, variables, constants and complex mode.
Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.
Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?