Combination and Permutation Calculator
Enter how many fields there are (N) and how many you pick (k). You get the exact number of combinations or permutations, written out in full and in scientific notation, plus the odds of guessing everything with one ticket. Example: picking 6 numbers out of 40, as in many 6/40 lotteries, gives 3,838,380 combinations.
Defaults to your region. Switch to compare any other scale.
e.g. 40 numbers on the ticket (0–1000)
Result
3,838,380
Combinations C(40, 6)
There are 3,838,380 different ways to choose 6 fields out of 40.
- Combinations (order doesn't matter)Combination — the number of ways to choose k items out of N when the order doesn't matter.
- FormulaC(40, 6) = 40! / (6! · (40 − 6)!) = 40! / (6! · 34!)
- Shortened product(40 · 39 · 38 · 37 · 36 · 35) / 6! = 2,763,633,600 / 720 = 3,838,380
- Number of digits7
- Odds of guessing all with one ticket1 in 3,838,380 (0.0000261 %)
- For comparison: Permutations P(40, 6)2,763,633,600
About this tool
Combinations vs. permutations: a combination ignores order — {1, 2, 3} and {3, 2, 1} are the same ticket — so C(N, k) = N! / (k! · (N − k)!). A permutation counts every order separately, so P(N, k) = N! / (N − k)!, which is C(N, k) multiplied by k!. For 6 of 40: C = 3,838,380 and P = 2,763,633,600 (720 times more, because 6 people can line up in 720 ways).
Lotteries and similar games: in a draw where k numbers out of N are picked and order does not matter, C(N, k) is the number of different possible tickets, and one ticket's chance of matching all numbers is 1 in C(N, k). Lotto 6/49 has 13,983,816 combinations; a 5-of-69 main draw has 11,238,513. Bonus balls and extra fields change the total, so check your game's official rules.
The arithmetic is exact (big integers), so even C(1000, 500) is shown digit by digit. Related tools: random number generator, statistics calculator, percentage calculator.
Formula
C(N, k) = N! / (k! · (N − k)!)P(N, k) = N! / (N − k)! = C(N, k) · k!Odds of matching all = 1 / C(N, k)Example: C(40, 6) = 3,838,380; P(40, 6) = 2,763,633,600
How it is calculated
- Choose combinations (order doesn't matter, like a lottery ticket) or permutations (order matters).
- Enter the total number of fields N and how many you pick, k.
- The calculator shortens the factorials to a product of k terms, e.g. C(40, 6) = 40·39·38·37·36·35 / 6!.
- The result is computed exactly with big integers and shown with digit grouping and, for long numbers, in scientific notation.
- For combinations you also see the odds of guessing all k numbers with one ticket: 1 in C(N, k).
Questions
What is the difference between a combination and a permutation?
In a combination the order does not matter (a lottery ticket), in a permutation it does (a podium or a PIN). P(N, k) = C(N, k) × k!, so 6 of 40 gives 3,838,380 combinations but 2,763,633,600 permutations.
How many variants does a 6-of-40 lottery have?
C(40, 6) = 3,838,380. If only the six main numbers count and order does not matter, one ticket has a 1 in 3,838,380 chance of matching all six. Real games may add bonus numbers or other prize tiers, so always check the official rules.
Why is C(N, k) the same as C(N, N − k)?
Choosing the k items you keep is the same as choosing the N − k you leave out. So C(40, 6) = C(40, 34) = 3,838,380, and C(N, 0) = C(N, N) = 1.
Why is the result also shown in scientific notation?
Counts grow extremely fast: C(100, 50) already has 30 digits. The full number is always exact, and from 16 digits up a short form like 1.009 × 10²⁹ makes it easier to read.