Lottery odds calculator
In a 6-from-49 game, matching exactly 3 numbers covers 246820 of the 13983816 possible draws, while the jackpot is a single one of them. Enter the pool, the draw size and your matches to see the probability and the odds against. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 49
- Resistance (Ω)
- 6
- M
- 3
- Probability
- 0.0176504039
- Favorable combinations
- 246,820
- Total combinations
- 13,983,816
- Odds against
- 55.6559273965
The lottery odds calculator answers a precise combinatorial question: if a game draws r numbers from a pool of n, and your ticket also has r numbers, what is the probability that you match exactly m of them? That is the hypergeometric lottery model used by classic 6-from-49 style games and by many classroom examples. You supply the pool size n, the draw size r, and the match count m; the engine returns the exact probability, the favorable and total combination counts when they fit in ordinary floating-point arithmetic, and the odds against that outcome. When a game adds a separate bonus ball, you can pass the bonus pool size and whether your ticket hits the bonus, and the tool multiplies the main probability by the bonus hit or miss factor to produce a joint probability and joint odds against. All arithmetic is deterministic—log-space binomial coefficients, no random sampling, no network, no clock—so the same inputs always produce the same outputs.
What lottery odds mean and how to read them
An n-choose-r lottery fills a ticket with r distinct numbers chosen from a pool of n, then draws r distinct numbers from the same pool without replacement. Your prize tier is usually defined by how many numbers on the ticket also appear in the draw.
If M is that match count, the probability of exactly m matches is given by the hypergeometric formula P of M equals m equals C of r choose m times C of n minus r choose r minus m, all divided by C of n choose r. The numerator counts ways to keep m of your ticket numbers and fill the remaining draw slots from the numbers you did not pick; the denominator is every possible draw of size r.
This calculator returns that probability as a floating-point number in the closed unit interval, the favorable combination count, the total combination count C of n choose r, and odds against defined as one minus p over p so that a probability of one in a million appears as roughly nine hundred ninety-nine thousand nine hundred ninety-nine to one.
Impossible match counts inside the legal range zero through r—for example asking for too many outside numbers when r is large relative to n—yield probability zero rather than a cryptic error, which keeps batch jobs stable. Required inputs are n, r, and m.
Where lottery odds fit in study, product design, and code
Students meet n-choose-r odds when a textbook asks for the chance of matching three numbers in a six-from-forty-nine game, when a worksheet wants odds against a full jackpot, or when they verify that hypergeometric formulas match the definition built from combinations. Teachers can pre-generate answer keys for modest pools without trusting opaque calculator apps that round intermediate coefficients or hide the match-count definition.
Game designers and product managers sketch prize ladders: fix n and r from the rules, then scan m from zero to r to see how steeply probability falls as the match tier rises, and optionally fold in a bonus pool to model power-ball style jackpots. Journalists and curious players use the same contract to translate marketing slogans into explicit odds against before writing explainers. Contest practice often needs a fast offline source of lottery values so solutions can be checked without embedding large static tables by hand.
What you can do with it
Homework and exam preparation
Look up exact hypergeometric lottery probabilities for textbook n-choose-r exercises, including odds against and combination counts.
Prize-tier and jackpot sketches
Scan match counts m for fixed n and r, optionally with a bonus pool, to design prize ladders or explain jackpot odds in plain numbers.
FAQ
What does the lottery odds calculator cost?
It is free in your browser on this page.
What formula is used for matching exactly m numbers?
P(M = m) = C(r, m) · C(n − r, r − m) / C(n, r). That is the standard hypergeometric model for an n-choose-r lottery without replacement.
What happens if r is greater than n?
You cannot draw more numbers than exist in the main pool; r must be less than or equal to n.
Is this a jackpot payout or EV calculator?
No. It returns combinatorial match probabilities and odds against only. It does not model prize amounts, taxes, ticket cost, or expected monetary value.
What are the odds of hitting the jackpot in a 6-from-49 game?
Matching all 6 numbers is a single combination out of 13983816 possible draws, so the chance is 1 in 13983816. Matching exactly 3 is far more likely, with 246820 of those draws.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/prob/lottery-odds \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":49,"r":6,"m":3}'const res = await fetch("https://api.kit.forhosting.com/prob/lottery-odds", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 49,
"r": 6,
"m": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/prob/lottery-odds",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 49,
"r": 6,
"m": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/prob/lottery-odds", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":49,"r":6,"m":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":49,"r":6,"m":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/prob/lottery-odds", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 49,
"r": 6,
"m": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "prob.lottery_odds",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 10000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What n-choose-r lottery odds mean and what the response contains
The engine rejects r greater than n with invalid_input, because you cannot draw more numbers than exist in the pool; that is the hard combinatorial constraint the product page emphasizes. Optional fields cover a separate bonus ball: bonus_n is the size of that secondary pool, and match_bonus says whether the joint event includes hitting the bonus. The response echoes normalized parameters, attaches formula strings for learners who want to cross-check by hand, and publishes max_n so clients can validate before they send work. This page is not a jackpot payout estimator, a tax calculator, or a Monte Carlo simulator of many tickets. It is the exact combinatorial odds tool for match counts in an n-choose-r draw with an optional independent bonus factor, free to run in the browser and priced consistently through the API.
How n, r, m, and the optional bonus ball are read and computed
Optional leading plus signs on integers are allowed; embedded spaces, hex prefixes, negatives where forbidden, and scientific notation on integer fields are rejected so a bad cell does not become a wrong jackpot figure. The match count m must lie between zero and r inclusive; m above r is rejected rather than silently returning zero in a way that could hide an off-by-one in a caller. Main probability uses logarithms: log C of r choose m plus log C of n minus r choose r minus m minus log C of n choose r, then the exponential recovers a probability. That path avoids intermediate overflow that full factorials would cause for larger pools. Combination counts are also returned from a multiplicative product rounded to the nearest representable number when finite. Joint probability is the product of the main hypergeometric term and the chosen bonus factor; joint odds against follow the same one-minus-p over p definition. The preferred fields are n for the main pool size, r for how many numbers are drawn and printed on each ticket, and m for the exact match count you care about. Aliases are accepted so spreadsheets and scripts can keep familiar names: for n the aliases are pool, pool_size, balls, and total; for r they are draw, drawn, picks, ticket_size, and k; for m they are matches, match, and hits. The rule r must not exceed n is checked after both values are parsed and surfaces a clear invalid_input message that names the fields. When bonus_n is present, the engine treats the bonus as an independent uniform draw from a separate pool: the hit probability is one over bonus_n and the miss probability is bonus_n minus one over bonus_n. The boolean match_bonus defaults to true if you omit it while supplying a bonus pool, so a single jackpot-style query is easy; set it false to get the joint probability of a main tier with a missed bonus. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing binomial coefficients yourself.
Where lottery odds fit in study, product design, and code
Developers call the endpoint from scripts to seed deterministic test vectors, to illustrate log-space coefficient tricks, or to satisfy programming-challenge statements that demand P of exactly m matches for given n and r. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with binomial probability tools when trials are independent with replacement rather than a fixed draw without replacement, with combinatorial counters when you need only C of n choose r, and with other math endpoints when you are building a small lab of free, deterministic probability helpers for education and product work.
Integration use cases
Deterministic test fixtures
Generate reproducible probability, combinations, and odds fields for unit tests and CI without hand-rolled binomial coefficients.
Technical questions
How does the optional bonus ball work?
When bonus_n is set, the tool multiplies the main probability by 1/bonus_n if match_bonus is true, or by (bonus_n − 1)/bonus_n if false, and returns joint_probability and joint_odds_against.