Enter n and r values above
Click Calculate to see combinations and permutations// calculate C(n,r) and P(n,r) with full formula breakdown
Calculate combinations C(n,r) and permutations P(n,r) instantly. Shows step-by-step factorial formulas, results, and all arrangement counts for any n and r values.
Enter n and r values above
Click Calculate to see combinations and permutationsType the total number of items in your set (e.g. 10 students).
Type how many items you're choosing or arranging (e.g. 3 positions).
Click Calculate to see C(n,r) and P(n,r) with full formula steps and a reference table.
This tool calculates both combinations C(n,r) ā where order doesn't matter ā and permutations P(n,r) ā where order does matter ā for any non-negative integers n and r. It shows the complete factorial breakdown so you can understand exactly how the result is computed.
A combination counts the number of ways to choose r items from n where order does not matter. A permutation counts arrangements where order does matter. For example, choosing 3 toppings from 10 is a combination; arranging 3 runners on a podium from 10 is a permutation.
The combination formula is: C(n, r) = n! / (r! Ć (nār)!) where ! denotes factorial. This is also written as "n choose r" or shown with binomial coefficient notation.
The permutation formula is: P(n, r) = n! / (nār)!. Since order matters in permutations, there are always more permutations than combinations for the same n and r (when r > 1).
No ā r must be less than or equal to n. You cannot choose more items than exist in the set. The calculator will show an error if r > n.
Both equal 1. There is exactly one way to choose zero items from a set (the empty selection), and exactly one way to arrange zero items. This is consistent with the definition of 0! = 1.
This tool uses JavaScript BigInt for client-side calculations, supporting very large numbers. Values up to n = 1000 are accepted, though results may have hundreds of digits for large inputs.
A factorial of a non-negative integer n (written n!) is the product of all positive integers from 1 to n. For example, 5! = 5 Ć 4 Ć 3 Ć 2 Ć 1 = 120. By convention, 0! = 1.
Because P(n, r) = C(n, r) Ć r!. Permutations include all the orderings of each combination. When r = 1, P = C. For r ā„ 2, P is always strictly larger than C since r! ā„ 2.
A combination and permutation calculator is a mathematical tool that computes the number of ways to select or arrange items from a set. Whether you're solving a probability problem, preparing for an exam, analyzing game odds, or working on a software algorithm, knowing how many possible outcomes exist is fundamental. This free online calculator handles both C(n,r) and P(n,r) instantly, showing you the complete factorial breakdown so you understand not just the answer, but the method behind it.
š” Looking for premium web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and developer tools ā worth checking out.
A combination answers the question: "In how many ways can I choose r items from a group of n, if the order of selection does not matter?" The formula is:
C(n, r) = n! / (r! Ć (nār)!)
For example, if you want to choose 3 pizza toppings from a menu of 10, the order you pick them doesn't affect the final pizza. So C(10, 3) = 120 possible combinations. Combinations appear in probability theory, statistics, the binomial theorem, and many areas of discrete mathematics.
A permutation answers the question: "In how many ordered arrangements can I place r items from a group of n?" The formula is:
P(n, r) = n! / (nār)!
For example, if 10 runners enter a race and you want to know how many distinct ways the gold, silver, and bronze medals can be awarded, the order matters ā P(10, 3) = 720 arrangements. Permutations are used in cryptography, scheduling, seating arrangements, and counting ordered sequences.
The crucial distinction between combinations and permutations is whether the order of selection matters. Consider choosing 2 letters from {A, B, C}:
This is why P(n,r) = C(n,r) Ć r! ā each combination generates r! permutations through its different orderings.
Both formulas rely on factorials. The factorial of n (written n!) is the product of all positive integers up to n:
Factorials grow extremely fast. 20! is already over 2 quintillion. This calculator uses JavaScript's BigInt type to handle arbitrarily large factorials without losing precision, unlike floating-point arithmetic which would introduce rounding errors.
Lottery odds: If a lottery draws 6 numbers from 49, the number of possible tickets is C(49, 6) = 13,983,816. Order doesn't matter (the balls aren't ranked), so we use combinations.
Password security: If a 4-digit PIN uses digits 0ā9 without repetition, the number of possible PINs is P(10, 4) = 5,040. Order matters because 1234 and 4321 are different PINs.
Team selection: Choosing 5 players from a squad of 20 for a basketball starting lineup is C(20, 5) = 15,504 possible teams.
Seating arrangements: Arranging 4 guests in 4 specific chairs from a group of 8 people is P(8, 4) = 1,680 arrangements.
Several edge cases are worth noting: C(n,0) = P(n,0) = 1 for all n (there's exactly one way to choose or arrange nothing). C(n,n) = 1 (only one way to choose all items). C(n,1) = n (you can choose any single item). P(n,n) = n! (the number of ways to arrange all n items, also called a full permutation).
Enter n (the total set size) and r (how many to choose or arrange), then click Calculate. The tool immediately computes C(n,r) and P(n,r) using BigInt arithmetic to handle very large numbers precisely. It then displays a step-by-step factorial breakdown ā showing n!, r!, and (nār)! individually ā so you can follow the math. A quick-reference table lists all C(n,k) and P(n,k) for k from 0 to n, making it easy to compare values across different r selections at once.