ForHosting KIT · Math

Dice roll probability

Rolling exactly 7 with two six-sided dice happens in 6 of 36 outcomes, a 1/6 chance. Pick the number of dice, the sides and your target, then choose exact or at-least for 'this or higher' rolls. 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 sum to hit
7
Calculation mode
exact
You get
Min sum
2
Max sum
12
Total outcomes
36
Favorable
6

When you roll several fair dice, every face combination is equally likely, but the sums are not: middle totals appear more often than extremes. This capability computes the exact probability of hitting a chosen target sum with k dice that each have s faces labeled one through s. The engine enumerates outcome counts with integer dynamic programming, divides by sides to the power of dice, and returns favorable ways, total outcomes, a reduced fraction, a stable decimal string, and a percentage.

What the dice-sum model covers and how probability is defined

A standard fair die with s sides shows each integer from one through s with equal chance one over s. Rolling k independent dice produces sides to the power k equally likely face tuples. The sum of the faces ranges from a minimum of k (every die shows one) to a maximum of k times s (every die shows its highest face).

Because many different face tuples share the same sum, the distribution over totals is unimodal and peaks near the middle: two six-sided dice make seven six ways out of thirty-six, while two and twelve each appear only once. Exact probability is favorable outcomes over total outcomes. For mode exact, favorable is the number of tuples whose faces add to the target.

The implementation never samples random rolls; it builds the generating function coefficient array with dynamic programming so every answer is exact for the published integer limits. When you only need a single comparison, one request returns both the fraction and the decimal so you can display either form without recomputing.

Practical tips, limits, and how this differs from related tools

Stay inside dice at most thirty and sides at most one hundred so the dynamic-programming table stays modest: state grows with dice times maximum sum, and each step multiplies by the side count. If you need the full distribution over every sum, call once per target or chain from a local copy of the same DP idea; this landing is optimized for a single named target, which matches how people search for a dice roll probability calculator.

Do not confuse this with combinations or multinomial landings elsewhere in the kit: those answer “how many ways to choose unordered sets,” not “what is the chance the faces add to a number.” Prefer the fraction field when you need exact rational comparison across tools; use the decimal string when you only need stable display digits without floating-point surprises from ad-hoc division in a spreadsheet.

Tabletop and RPG difficulty checks

Convert “roll X or higher on kd s” into an exact probability for balancing encounters, skill DCs, and house rules without Monte Carlo spreadsheets.

Game design and simulation sanity checks

Validate that a custom polyhedral setup (for example 4d8 targeting fifteen) has the intended hit rate before shipping tables into a product or print rulebook.

What faces does each die use?

Fair standard faces labeled 1 through sides inclusive. A six-sided die therefore shows 1, 2, 3, 4, 5, or 6 with equal probability.

Why does an impossible target return an error?

Sums below the number of dice or above dice×sides cannot occur.

Is the result approximate or exact?

Counts are exact integers via dynamic programming and BigInt division for the fraction. The decimal string is a fixed-precision expansion of that rational; no random sampling is used.

Is the dice roll probability calculator free?

The browser tool is free and runs locally.

How do I get the chance of rolling a total or higher?

Choose the at-least option instead of exact. The calculator then adds the ways for every total from your target up to the maximum, which answers 'roll this or higher' checks in board games and role-playing games.

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/prob/dice-target

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/prob/dice-target \
  -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": "prob.dice_target",
  "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_dice30
max_sides100
max_sum3000
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.

Choose mode exact for P(sum equals target) or mode at_least for P(sum is greater than or equal to target). Targets outside the achievable range—below the number of dice or above dice times sides—are rejected with invalid_input so game rules and homework answers stay honest.

What the dice-sum model covers and how probability is defined

For mode at_least, favorable is the sum of way-counts from the target through the maximum sum inclusive—useful for “roll this or higher” checks in games. Coin flips and one-sided nonsense are out of scope: sides must be at least two, dice at least one, and the product of dice and sides must stay within the documented sum ceiling so Worker and browser stay snappy.

How to call the API and read the JSON response

Classic check: two six-sided dice targeting seven in exact mode yields six favorable outcomes out of thirty-six, fraction one sixth, probability about zero point one six six seven. Send a JSON body with three required integers and one optional mode string. Field dice is the number of dice k, from one through thirty; aliases k, n, and count are accepted. Field sides is the number of faces s, from two through one hundred; aliases s and faces map to the same meaning. Field target is the sum you care about; aliases sum, t, and goal work interchangeably. Optional mode defaults to exact; set at_least (or aliases gte, greater-or-equal style tokens, or_more) when you want the cumulative upper tail. A successful response echoes dice, sides, target, mode, min_sum, max_sum, and a compact notation such as 2d6. It also returns total_outcomes and favorable as decimal digit strings (BigInt-safe), probability as a trimmed fixed-point string, probability_number as an IEEE double convenience when finite, probability_fraction as a reduced numerator slash denominator, probability_percent as a percent string, and a short formula description of the comparison. The same target in at_least mode counts every sum from seven through twelve. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and how this differs from related tools

For classroom demos, prefer small known tables—2d6 sevens, 3d6 tens, advantage-style two-die comparisons—so students can recompute way counts by hand and match the API line by line. When designing RPG difficulty ladders, prefer at_least mode: a DC expressed as “roll ten or higher on 3d6” is exactly this cumulative probability. Failed validation—missing fields, non-integers, sides below two, mode gibberish, or an impossible target—returns invalid_input and never spends prepaid balance, so exploratory scripts stay cheap while learners probe the edges.

Homework and probability teaching labs

Give students a dice-sum question and check their hand-counted favorable outcomes, reduced fraction, and percent against a deterministic API or free browser result.

What is the difference between exact and at_least?

exact is P(sum = target). at_least is P(sum ≥ target), summing way-counts from the target through the maximum possible sum.

Read the full KIT documentation →