Guide
Permutations and combinations: nPr, nCr and counting with repeats
Counting problems look simple until the numbers get large or the rules of the problem change: does order matter, can items repeat, are some items identical? This calculator answers the standard counting questions for one n and r at the same time, as exact big integers, so that 52! or the number of poker hands is not rounded, and it adds a counter for the distinct arrangements of a word.
The formulas
A permutation counts ordered selections of r items from n: nPr = n! / (n − r)!. A combination counts unordered selections: nCr = n! / (r! (n − r)!), which is nPr divided by r!. With repetition allowed, an ordered choice has nʳ possibilities, and an unordered choice has C(n + r − 1, r), the number of multisets of size r. The tool also gives n!, r! and the circular arrangements of n items, (n − 1)!.
What the page shows
Enter n and r, and optionally a word or string of items. The page opens on n = 10, r = 3 and the word MISSISSIPPI, and lists nPr = 720, nCr = 120, permutations with repetition 1,000, combinations with repetition 220, 10! = 3,628,800, 3! = 6, circular arrangements 362,880 and 34,650 distinct arrangements of the word, with the repeated letters I×4, S×4 and P×2. A Pascal’s triangle row appears for n up to 30.
Exact big numbers
Factorials grow very quickly: 20! is 2,432,902,008,176,640,000 and 52! has 68 digits. The tool uses big integers throughout, so nothing is rounded, and results longer than 60 digits are written as the first digits times a power of ten together with the exact number of digits, for example 8.065817 × 10^67 (68 digits) for 52!. Values are limited to n and r of 1,000 or less.
Worked examples
Awarding three medals among ten athletes is 10P3 = 720; choosing a team of three is 10C3 = 120. A five-card poker hand from 52 cards is 52C5 = 2,598,960 hands, while ordered deals number 311,875,200. A 6-from-49 lottery has 49C6 = 13,983,816 combinations, so one ticket wins the jackpot with probability 1 in 13,983,816. The letters of STATISTICS can be arranged in 10! ÷ (3! × 3! × 2!) = 50,400 distinct ways.
Repetition and circular arrangements
When items can repeat, as in a four-digit PIN, use nʳ: 10⁴ = 10,000. When identical items can be chosen but order does not matter, as with scoops of ice cream from 5 flavours, use C(n + r − 1, r). For seating n people at a round table where only relative positions matter, the number of arrangements is (n − 1)!, because rotating everyone does not give a new seating. The tool reports all of these for the same n and r.
Edge cases
If r is larger than n, nPr and nCr are not defined, and the page says so while still giving the counts with repetition. r = 0 gives 1 way for nPr and nCr, since there is exactly one way to choose nothing. A word with no repeated letters gives n!, and spaces are ignored. Results are counts, not probabilities: divide by the total number of outcomes to turn them into a chance.
Limits
The tool counts arrangements but does not list them, and it does not solve problems with restrictions such as items that must or must not sit together; split those into cases by hand. It works with whole numbers up to 1,000 only. For probability questions, use the count of favourable outcomes divided by the count of all outcomes from this page.
Related tools
- GCD and LCM Calculator gives the factorizations behind the big integers.
- Dice Roller lets you test counting results by simulation.
- Random Number Generator draws samples from the sets you have just counted.
- Percentage Calculator converts a ratio of counts to a percent.
Checked against the current version of the Permutation and Combination Calculator on .

