ForHosting KIT · Home, food & hobbies

Dice probability calculator

Two six-sided dice add up to 7 in 6 of 36 outcomes, a chance of exactly 1/6. Enter how many dice, how many sides and the sum you need, and get the exact odds, not a simulation. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Dice
2
Sides
6
Target
7
You get
Total
36
Min sum
2
Max sum
12
Ways
6

This dice probability calculator returns the exact probability that a given number of fair dice, each with a stated number of sides, add up to a target sum. Board games, tabletop RPGs, and classroom probability drills all ask the same question in different clothing: two standard six-siders summing to seven, three d20s totaling thirty, or a custom polyhedral set hitting a damage threshold. The engine counts every outcome with dynamic programming over the dice, divides by sides to the power of the dice count, and returns both a reduced fraction and a rounded decimal—no Monte Carlo sampling, no network calls, and no date-dependent shortcuts. Classic checks include two d6 to seven at six over thirty-six (one sixth), and a single d6 to four at one sixth.

What exact dice odds mean and what you get

Exact dice-sum probability answers a discrete question: each die shows an integer from one through its number of sides, every face is equally likely, rolls are independent, and you want the chance that the faces add to a chosen target. The sample space has size sides raised to the number of dice; the favorable outcomes are the ordered tuples whose components sum to the target.

This calculator enumerates those favorable counts with a deterministic dynamic-programming recurrence rather than listing every tuple, which keeps modest table sizes while remaining exact in integer arithmetic. Targets outside the reachable band correctly yield zero ways and probability zero without throwing, because an impossible sum is a valid mathematical answer. There is no continuous approximation, no normal-curve shortcut, and no random sampling of rolls—the engine either finishes with exact counts or fails closed with a clear message.

Where dice probabilities fit in play, study, and software

Players meet dice-sum questions when a ruleset asks for two d6 totals, when a critical-hit table keys off three d8 damage, or when a homebrew system needs the chance of beating a target number with polyhedral pools. Teachers use the same numbers to introduce sample spaces, complementary events, and why seven is the mode on two fair six-siders before moving to generating functions or inclusion-exclusion.

Developers call the contract from scripts to seed deterministic tables for game engines, to validate Monte Carlo code against exact small cases, or to power tutorial UIs that must show both a fraction and a percent without inventing floating noise. Contest and homework drills often need a fast offline source of exact answers so students can check work without opaque calculator apps that silently round too early.

Product tools for virtual tabletops and character builders use the rewrite when a designer types dice, sides, and a damage threshold and the UI must display the true hit chance.

Tabletop and board-game odds

Compute exact chances for 2d6, 3d8, or custom polyhedral pools before a session or when balancing homebrew tables.

Homework and probability drills

Check sample-space answers with reduced fractions and decimals that match textbook two-dice and multi-dice exercises.

What does the dice probability calculator cost?

It is free in your browser on this page.

How is the probability defined?

Each die shows 1..sides uniformly and independently. P(sum = target) equals the number of favorable ordered outcomes divided by sides raised to the number of dice.

What happens if dice or sides is zero or negative?

Dice and sides must be positive integers within the supported maxima.

What if the target sum is impossible?

The calculator returns ways 0, probability 0, and fraction 0/1. Impossible sums are valid answers, not errors.

Is this Monte Carlo or exact?

Exact. Counts use integer dynamic programming over the dice; there is no random sampling and no Date dependence.

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.

POSThttps://api.kit.forhosting.com/hobby/dice-probability

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.

curl -X POST https://api.kit.forhosting.com/hobby/dice-probability \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dice":2,"sides":6,"target":7}'
{
  "dice": 2,
  "sides": 6,
  "target": 7
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "hobby.dice_probability",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_dice40
max_sides100
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

What exact dice-sum probability means and what the response contains

The response echoes the validated dice count, sides per die, and target; reports the reachable range as min_sum equals the number of dice and max_sum equals dice times sides; returns ways and total as decimal strings so large powers of sides never lose digits; and exposes probability as a rounded decimal, probability_fraction as a fully reduced ways-over-total string, percent as one hundred times the same ratio, plus the precision used, a method tag exact_dp, and a short formula reminder. Rejected cases are different: missing fields, non-integers where integers are required, non-positive dice or sides, and values above the documented ceilings produce invalid_input so a bad form cell never becomes a silent wrong percentage.

How dice, sides, and target are read and how results stay reproducible

Dice and sides must be positive whole numbers within the published maxima; zero, negatives, fractions, scientific notation, and leading zeros on multi-digit strings are rejected with messages that explicitly call out non-positive dice or sides when that is the fault. Target may be any safe integer, including values below the minimum sum or above the maximum sum, in which case ways is zero and the fraction is zero over one. Internally the recurrence builds a map of partial sums after each die, adding faces one through sides with BigInt counters, then divides by sides to the power of dice with bigint-safe rounding half away from zero. The preferred fields are dice for how many dice you roll, sides for faces per die numbered from one upward, and target for the desired sum, with aliases n, num_dice, and count for dice; s, faces, and faces_per_die for sides; and sum, t, and goal for target so spreadsheets, query strings, and typed forms can reuse the same contract. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for probability and percent, defaulting to ten and capped at fifteen so JSON goldens stay stable across runtimes. 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 the dice DP yourself.

Where dice probabilities fit in play, study, and software

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 or other probability endpoints when you need related discrete models, and with other hobby math helpers when you are building a small lab of free, deterministic tools for games and study.

Deterministic game and CI fixtures

Generate reproducible ways, totals, and probability_fraction strings for unit tests and Monte Carlo cross-checks.

Read the full KIT documentation →