# Dice Probability Calculator

> Computes the exact probability that the sum of several dice equals, is at least or at most a target value (by convolution of the face distributions), or that at least one die shows a specific face, with favourable and total outcomes and the odds.

- Calculator id: `dice-probability` · Category: Statistics & Probability (`statistics`) · Tool name: `calculate_dice_probability`
- Canonical page: https://tttkmbb.com/statistics/dice-probability · This document: https://tttkmbb.com/statistics/dice-probability.md · JSON definition: https://tttkmbb.com/statistics/dice-probability.json

## Purpose

Computes the exact probability that the sum of several dice equals, is at least or at most a target value (by convolution of the face distributions), or that at least one die shows a specific face, with favourable and total outcomes and the odds.

**Use when:** You need probabilities for rolling dice of any number of sides (d4 to d100): totals in board games and role-playing games, or the chance of at least one six in several rolls.

**Do not use when:** The dice are weighted or you want the probability of a number of successes among trials with a given per-trial probability (use binomial-distribution).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `dice` | integer |  | required | How many dice are rolled together. (min 1, max 50) |
| `sides` | integer |  | required | Faces on each die, numbered 1 to sides (6 for a standard die). (min 2, max 100) |
| `target` | enum: sum_equals \| sum_at_least \| sum_at_most \| at_least_one_specific |  | optional, default "sum_equals" | Which event to evaluate. |
| `target_value` | integer |  | required | The sum of interest, or the face value (1 … sides) for at_least_one_specific. (min 1) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `probability` | number |  | Probability of the event, 0 to 1. |
| `probability_percent` | number | % | Same probability in percent. |
| `odds` | string |  | Probability expressed as '1 in N'. |
| `favorable_outcomes` | number |  | Number of ordered dice results producing the event. |
| `total_outcomes` | number |  | sides^dice ordered results. |
| `expected_sum` | number |  | dice × (sides + 1) / 2. |
| `sum_std_dev` | number |  | √(dice × (sides² − 1) / 12). |

## Formula

`P(sum = s) from the convolution of dice uniform distributions on 1…sides; P(sum ≥ s) = Σ_{j ≥ s} P(sum = j); P(at least one die shows f) = 1 − ((sides − 1)/sides)^dice; expected sum = dice(sides + 1)/2; variance = dice(sides² − 1)/12`

Exact enumeration by iterated convolution (no simulation); sums outside dice … dice × sides have probability 0 and trigger a note. All dice are fair and independent.

## Data Sources

- Wolfram MathWorld – Dice — https://mathworld.wolfram.com/Dice.html (reference, retrieved 2026-09-24)
- Wikipedia – Dice — https://en.wikipedia.org/wiki/Dice (reference, retrieved 2026-09-24)
- Wolfram MathWorld – de Méré's Problem — https://mathworld.wolfram.com/deMeresProblem.html (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/dice-probability?dice=…&sides=…&target_value=…`
- `POST https://tttkmbb.com/api/v1/calculate/dice-probability` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/dice-probability · OpenAPI operationId `calculate_dice_probability` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "dice-probability", "inputs": {…}}`

## Example

- Sum of two dice equals 7: inputs `{"dice":2,"sides":6,"target":"sum_equals","target_value":7}` → `{"probability":0.166667,"probability_percent":16.67,"odds":"1 in 6","favorable_outcomes":6,"total_outcomes":36,"expected_sum":7,"sum_std_dev":2.4152}`
- At least one six in four dice (de Méré): inputs `{"dice":4,"sides":6,"target":"at_least_one_specific","target_value":6}` → `{"probability":0.517747,"probability_percent":51.77,"favorable_outcomes":671,"total_outcomes":1296,"expected_sum":14}`

```
GET https://tttkmbb.com/api/v1/calculate/dice-probability?dice=2&sides=6&target=sum_equals&target_value=7
```

## Limitations

The dice are weighted or you want the probability of a number of successes among trials with a given per-trial probability (use binomial-distribution). Exact enumeration by iterated convolution (no simulation); sums outside dice … dice × sides have probability 0 and trigger a note. All dice are fair and independent. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is 7 the most likely total of two dice?**

Six of the 36 ordered outcomes (1+6, 2+5, 3+4, 4+3, 5+2, 6+1) sum to 7, more than any other total; the distribution of a sum of dice is triangular for two dice and approaches a bell curve for more.

**What is de Méré's problem?**

Whether at least one six in four rolls (51.77 %) is more likely than at least one double six in 24 rolls of two dice (49.14 %); the calculator gives the first directly (dice = 4, target 6) and the second with dice = 24, sides = 36, target 36.

## Related

- [Binomial Distribution Calculator](https://tttkmbb.com/statistics/binomial-distribution.md) — Number of dice showing a given face.
- [Expected Value Calculator](https://tttkmbb.com/statistics/expected-value.md) — Expected payoff of a dice game.
- [Probability of Two Events Calculator](https://tttkmbb.com/statistics/probability-of-events.md) — Combine two independent dice events.
