ForHosting KIT · Math

Random dice roller

Two six-sided dice with seed 42 land on 1 and 5 for a total of 6, out of a possible 2 to 12. Choose how many identical dice to throw, how many sides each has and a seed, and see every face plus the sum. 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
Seed
42
You get
Total
6
Rolls
1, 5
Min total
2
Max total
12

A random dice roller is the general-purpose way to simulate a handful of identical dice and see every face plus the sum. People search for a random dice roller when they need two six-sided cubes for a board game, four eight-sided dice for a classroom experiment, or ten ten-sided dice for a programming challenge, without switching to a twenty-sided-only tool or learning tabletop notation such as 2d6+3. This capability accepts a positive integer dice count, a positive integer side count, and a non-negative integer seed, then returns each individual roll and the total.

How the random dice roller simulates a pool

A random dice roller answers a different question from a probability mass table or an expected-value formula. You already know that each fair die is uniform on the integers from one through the number of sides; what you want is one concrete sample: the faces that came up and the integer total they add to. This landing is built for that sample.

You choose how many identical dice to throw and how many sides each die has, then you publish a seed so the draw can be reconstructed later. The engine folds the seed into a thirty-two-bit mulberry32 state and, for every die in order, takes one unsigned word and maps it onto the closed range from one through S with a remainder. Face one is included; face S is included; face zero never appears.

Two dice with six sides therefore produce two integers in one through six and a total in two through twelve. Four dice with ten sides produce four integers in one through ten and a total in four through forty. A single two-sided coin-like die produces one integer in one through two.

Fairness is hard-coded as equal remainder bins; this page is not a loaded-die laboratory and it does not accept a bias vector. Keep-highest, exploding dice, and mixed pools such as one twenty-sided die plus three four-sided dice belong to other search intents. Here every die in the pool is the same S-sided cube, which is exactly what people type when they search for a random dice roller rather than a notation parser.

Board games and family roll-and-move nights

Throw two six-sided dice or a custom pool and show every face plus the total, without teaching the table D and D notation.

Classroom trials of identical dice

Publish a seed and an N by S pool so every laptop in the lab reconstructs the same faces when students add the total by hand.

How do I roll N dice with S sides each?

Send dice and sides as positive integers, plus seed as a non-negative integer. The same triple always produces the same faces.

What happens if the dice count or side count is not a positive integer?

Missing values, zero, negatives, fractions, empty strings, and values outside the supported range are rejected and are not billed.

Why does a random dice roller take a seed?

The seed makes the pool reproducible. Two machines, two graders, or a later audit reconstruct the same faces. Seed zero is valid and is not treated as missing.

How is this different from a d20 roller or D and D notation?

This landing rolls N identical S-sided dice and returns every face plus the total. A d20 tool is one twenty-sided die. A D and D notation tool parses strings such as 2d6+3, including modifiers.

How do I get a fresh roll of the same dice?

Change the seed, for example by adding one to it. Keep the same seed when you want another person or a later check to see exactly the same faces and total.

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/random-dice-roller

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/random-dice-roller \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dice":2,"sides":6,"seed":42}'
{
  "dice": 2,
  "sides": 6,
  "seed": 42
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.random_dice_roller",
  "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_dice100
max_sides1000
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.

A dice count or side count that is not a positive integer fails with invalid_input instead of inventing faces.

How the random dice roller simulates a pool

The mapping never consults the wall clock or the host random device, so the same dice count, side count, and seed always serialize to the same JSON. That is what makes a random dice roller usable in continuous integration and in an audit: the word random describes the model of the die, not an unreproducible draw.

Fields, limits, and what invalid_input means

Example: two six-sided dice with a published seed always produce the same two faces and the same total, because the generator and the remainder map are fixed. Increment the seed when you want a fresh throw of the same pool; keep the seed when you want two machines or a later reviewer to see the same cubes. Failed validation does not consume balance. Pin the rolls array and the total in tests rather than asserting only the sum, so a change in face order cannot hide behind an unchanged total. POST a JSON body with three fields. dice is the required positive integer count of identical dice to throw; aliases count, n, and dice_count are accepted when a form reuses an older name. sides is the required positive integer number of faces on each die; aliases s, faces, and faces_per_die are accepted. seed is the required non-negative integer that initializes the generator; aliases rng_seed and value are accepted, and zero is a valid seed that is not treated as missing. Each numeric field may arrive as a JSON number or as a string of digits. Empty strings, booleans, objects, fractions, negatives, zero for dice or sides, and values outside the safe integer range fail with invalid_input and name the offending field. A dice count above one hundred or a side count above one thousand is rejected so a hostile payload cannot exhaust the isolate. Those failures are not billed. On success the body echoes dice, sides, and seed, returns rolls as the array of individual faces in throw order, returns total as their integer sum, and documents min_total, max_total, and a compact notation string such as 2d6 so a renderer can label the primary value without extra constants.

Board games, classrooms, and scripts that need N by S rolls

A family playing a roll-and-move game wants two six-sided dice and a visible pair of faces, not a 2d6+0 string they have to decode. A statistics teacher who is demonstrating the discrete uniform distribution and the shape of a sum of identical dice wants four eight-sided dice, a list of faces the class can add by hand, and a seed they can write on the board so every laptop shows the same trial. Contest organizers who pick a winner from the total of five twelve-sided dice need an auditable record: given the published seed, anyone can recompute the five faces and the total. Keep each request to one pool and one seed, stay inside the published dice and sides limits, and you get reproducible faces and totals for homework, LMS plugins, and edge workers without standing up a custom random service of your own.

Auditable contests and test fixtures

Record the seed next to a raffle or unit test so any later reviewer can recompute the exact rolls and the integer total.

What does the random dice roller 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 →