ForHosting KIT · Math

Expected value of a dice roll

Two six-sided dice average a total of 7, with possible sums running from 2 to 12. Enter how many dice and how many sides, and get the expected total, the mean per die and how widely the total spreads. 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
You get
Expected value
7
Expected per die
3.5
Min sum
2
Max sum
12

Board games, tabletop RPGs, classroom probability units, and game-design spreadsheets all ask the same simple question: if you roll a given number of fair dice with a given number of faces, what total should you expect on average? The expected value of a dice roll is not a single sample outcome and not a probability of hitting one target sum; it is the long-run mean of the total when every face from one through the number of sides is equally likely. This calculator accepts the count of dice and the sides per die, applies the closed-form mean for independent fair dice, and returns the expected total along with the per-die mean, the reachable min and max sums, and the variance and standard deviation of the total.

What the expected value of a dice roll means

A single fair s-sided die shows each integer face from one through s with probability one over s. The expected face value is therefore the average of those integers: one plus two plus up to s, all divided by s, which simplifies to (s plus one) divided by two. For a standard six-sided die that average is three point five; for a twenty-sided die it is ten point five; for a coin-like two-sided die it is one point five.

When you roll n independent identical dice and add the faces, linearity of expectation says the expected total is exactly n times the expected face of one die, even though the distribution of the sum is not uniform and even though the dice may be correlated in the narrative of a game. So E[sum] equals n times (s plus one) over two.

That formula is exact for the classical model of fair independent dice with consecutive faces starting at one; it does not require enumerating every combination, dynamic programming over ways, or Monte Carlo simulation. Use this tool when the search intent is the average or long-run mean total for n dice of s sides, not when you need P(sum equals k).

Where the average roll is most useful

Game designers balance weapons, spells, and damage tables against the average roll of a pool of polyhedral dice; a one-line expected-value call keeps design sheets honest without hand-computing (s plus one) over two for every row. Teachers and tutors use the same formula when introducing linearity of expectation before students build histograms of many trials, because the mean of two d6 is seven long before they have drawn the classic triangular distribution.

Backend services that price random rewards, loot drops, or board-game AI heuristics need a deterministic oracle that never drifts with a random seed and never invents a mean for zero dice. Failed validation does not consume balance. Keep requests small, pin the cleaned floating fields in tests, and you get reproducible averages for homework, design tools, and edge workers without standing up a probability library of your own.

Tabletop and RPG damage averages

Compute the expected total for weapon dice pools (for example 2d6 or 4d8) when balancing combat tables and character builds.

Classroom linearity of expectation

Show students that E[sum of n fair dice] is n times (s+1)/2 without enumerating every outcome first.

Game design and loot heuristics

Feed deterministic average rolls into economy simulators, loot drop models, and AI utility scores that need a mean, not a sample.

What happens if dice or sides is zero or negative?

Both dice and sides must be at least one; non-positive values are rejected and not billed.

Is the expected value of 2d6 really 7?

Yes. Each fair six-sided die has mean 3.5, so two independent dice have expected total 7. The most common sum is also 7, but the mean and the mode are separate concepts; this tool returns the mean.

Does this give the probability of a specific sum?

No. This calculator returns the long-run average total and related moments. For exact P(sum = target) use a dice probability capacity instead.

What is the average roll of a d20?

It is 10.5, the midpoint between 1 and 20. A six-sided die averages 3.5 and a two-sided die 1.5. The average is a long-run mean, not a face you can actually roll.

What are the lowest and highest totals I can roll?

The lowest equals the number of dice, when every die shows one. The highest is the number of dice times the sides, when every die shows its top face. Two six-sided dice range from 2 to 12.

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/stat/expected-dice-roll

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/stat/expected-dice-roll \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dice":2,"sides":6}'
{
  "dice": 2,
  "sides": 6
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.expected_dice_roll",
  "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.

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.

Invalid counts below one fail cleanly with invalid_input so automation never treats zero-sided or zero-dice nonsense as a successful zero result.

What the expected value of a dice roll means

It also does not answer questions such as the chance of rolling at least a fifteen or the full probability mass of every sum—those need a different probability endpoint.

Input contract, response shape, and error behaviour

Very large values above the documented safe range are rejected so floating results stay finite and comparable. POST a JSON body with two required positive integers: dice (aliases n, num_dice, count) for how many dice you roll, and sides (aliases s, faces, faces_per_die) for how many faces each die has. Both must be whole numbers at least one; zero, negative values, non-integers, missing fields, empty strings, and non-finite numbers fail with invalid_input and are not billed. On success the response echoes dice and sides, then expected_value for the total sum, expected_per_die for one die, min_sum and max_sum as the extremes when every die shows one or every die shows its highest face, variance and standard_deviation of the total under independence (each die has variance (s squared minus one) over twelve, so the total multiplies by n), plus formula and method strings for display and debugging. Example: two dice with six sides yields expected_value seven, expected_per_die three point five, min_sum two, and max_sum twelve. Pair the mean with your own simulation or a dedicated probability capacity if you also need the chance of beating a target; this endpoint is deliberately the analytic mean, not a sampler and not a full distribution.

How do I compute the expected value of a dice roll?

Send positive integers dice and sides. The API returns E[sum] = dice × (sides + 1) / 2 for fair independent dice with faces 1 through sides, plus per-die mean, min/max sum, variance, and standard deviation.

What does the expected value of dice roll calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →