Calculadora de Loteria
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
P = C(N,k) · C(T−N, N−k) / C(T, N)
About this calculator
The Lottery Calculator is a tool that computes the probability of hitting a specific number of numbers in a lottery game, such as Mega-Sena. You input the total numbers available on the ticket (T), how many numbers you chose (N), and how many hits you want to check (k). The result shows the chance of getting exactly k hits, considering that the draw selects N random numbers. For example, in Mega-Sena (T=60, N=6), the probability of hitting all 6 numbers (k=6) is 1 in 50,063,860.
The calculation uses combinations: first, it calculates how many ways we can choose k numbers among the N you marked (C(N,k)). Then, it calculates how many ways we can choose the N-k wrong numbers among the T-N unmarked numbers (C(T-N, N-k)). Multiplying these two values gives the number of favorable combinations. Dividing by the total number of possible combinations (C(T,N)) yields the probability. The formula is P = C(N,k) * C(T-N, N-k) / C(T,N).
You can use this calculator for any lottery that follows the format of choosing N numbers from a total T, such as Mega-Sena, Lotofácil, Quina, etc. Just adjust the parameters T, N, and k. It is useful for understanding how hard it is to win in each prize tier. For example, in Lotofácil (T=25, N=15), the chance of hitting 15 numbers is 1 in 3,268,760, while hitting 11 numbers is much more common.
Cautions: the calculator assumes all numbers have equal chance and no repetition. It does not account for special rules like 'bolão' or breakdowns. Also, the probability calculated is for exactly k hits, not 'at least k'. If you want the chance of hitting 4 or more, you need to sum the probabilities of 4, 5, and 6 hits. Remember that lottery is a game of chance and the odds are extremely low for top prizes.
Frequently asked questions
How do I use the calculator for Mega-Sena?
Set T=60 (total numbers), N=6 (numbers drawn), and k as the desired number of hits (e.g., 6 for the jackpot, 5 for quina, 4 for quadra). The calculator will show the probability of hitting exactly k numbers.
Does the calculator work for Lotofácil?
Yes. In Lotofácil, T=25 and N=15. You can choose any k between 11 and 15. For example, to hit 15, use k=15.
What is the difference between probability of exactly k and at least k?
The calculator gives the chance of hitting exactly k numbers. To get the chance of hitting at least k, you must sum the probabilities of k, k+1, ..., up to N.
Why is the probability so low for top prizes?
Because the number of possible combinations is huge. For example, Mega-Sena has over 50 million combinations, so the chance of hitting all is 1 in 50 million.
Can I use it to calculate chances for lottery pools?
The calculator considers a single bet. If you join a pool with more numbers, the probability increases, but the calculation is different. You would need to use the formula with a larger N (number of numbers played by the pool).