Lottery Odds Calculator
Compute the exact odds of winning a lottery. Pick p numbers from a pool of n; the draw selects d (usually d = p); find the probability of matching exactly k of them. The match count follows the hypergeometric distribution — P(match k) = C(p,k)·C(n−p, d−k) / C(n,d) — so the jackpot (match all) is 1 / C(n,p), which for a 6/49 lottery is 1 in 13,983,816. Add a separate bonus ball pool (Powerball's 1 of 26, Mega Millions' 1 of 25) and the jackpot odds multiply by that pool. Exact integer arithmetic via BigInt; a full match-distribution table is shown. Everything runs locally in your browser.
Match-k probability
Jackpot odds (match all p + bonus)
Full match distribution
The math. You hold a ticket of p favoured numbers out of a pool of n; d are drawn at random without replacement. The number of your numbers that come up, X, is hypergeometric: P(X = k) = C(p, k) · C(n−p, d−k) / C(n, d), where C(a,b) is the binomial coefficient. The numerator counts the ways to choose k of your p numbers AND d−k of the remaining n−p; the denominator is all possible draws. The jackpot needs k = p (and d = p), giving 1 / C(n, p). A separate bonus ball (a second independent draw of 1 from its own pool) multiplies the jackpot odds by that pool size — hence Powerball's 1 in 292,201,338 and Mega Millions' 1 in 302,575,350. The probabilities over all k sum to exactly 1 (Vandermonde's identity). Pairs with the Birthday Paradox, Permutation Generator, and Combination Generator. Everything runs locally — nothing leaves your browser.