Are the dice fair?
Yes. Every test passed on every platform.
- Mac (Apple's random source; iPhone and iPad use the same one, not run separately): 122 of 122 tests passed, and 4 of 4 exact checks, over 217,000,000 rolls.
- Windows PC: 122 of 122 tests passed, and 4 of 4 exact checks, over 217,000,000 rolls.
- Android phone: 122 of 122 tests passed, and 4 of 4 exact checks, over 217,000,000 rolls.
Each run is held to a 1% chance of a false alarm across all 122 tests together (Holm's correction), so a fair die passes the whole run about 99 times in 100.
How a roll is decided
Every roll Tablelight makes is decided once, on the DM's device (an iPhone, iPad, Mac or Windows PC), by one small piece of code that every version of the app shares. It asks the operating system for a random number from its cryptographic random source, the same kind used for passwords and encryption, and turns it into a face with a method that leaves every face exactly equally likely (no "modulo bias", the classic way to load a digital die by accident).
The dice you see tumbling on the screen don't choose anything. The number is decided first, and the throw is planned to land on it, the same way on every screen. We check that too: in every run, 500 planned throws of every die shape come to rest with exactly the decided face up.
Everything else follows the result. Glows and sparks, the flourish on a natural 20, a dice set's sounds and the room's smart lights all react to the number once it's decided; none of them can change it. A DM's secret roll sets nothing off until the DM has confirmed or changed it (see below).
Our own tests guard this. Whenever we run the tests for the code that decides rolls, a check reads the source of every version of the app and fails if any line asks for a random number through the standard random functions and isn't one we've reviewed, so a new effect can't quietly start choosing results. The statistical tests on this page are a separate, larger check, run again before every release (see How we tested).
Because each operating system has its own random source, the tests run on each one. Android phones join a table as players and never decide a roll there, but the same code runs on them, so we test Android's random source too.
10,000,000 d20s
The Mac rolled a d20 10,000,000 times. A fair die gives each face a twentieth. Hover over a bar for its count, or open the table below.
Chance never gives a perfectly even split. This is how far each face landed from its exact share, measured in the spread chance itself produces (standard deviations). A fair die stays mostly within ±2; a die that's too perfect would sit suspiciously close to zero every time.
The counts, face by face
| Face | Mac | Windows PC | Android phone |
|---|---|---|---|
| 1 | 500,773 | 500,114 | 500,069 |
| 2 | 501,211 | 499,117 | 501,129 |
| 3 | 500,555 | 500,780 | 499,436 |
| 4 | 499,107 | 499,289 | 499,826 |
| 5 | 499,475 | 500,669 | 499,526 |
| 6 | 498,874 | 499,583 | 500,719 |
| 7 | 497,858 | 500,793 | 499,748 |
| 8 | 499,893 | 500,802 | 499,752 |
| 9 | 500,298 | 499,690 | 500,745 |
| 10 | 500,881 | 499,774 | 497,812 |
| 11 | 500,111 | 500,056 | 500,142 |
| 12 | 499,973 | 499,287 | 500,453 |
| 13 | 498,867 | 499,239 | 500,418 |
| 14 | 500,280 | 500,901 | 499,842 |
| 15 | 500,852 | 500,660 | 500,020 |
| 16 | 499,744 | 499,730 | 500,922 |
| 17 | 500,384 | 500,596 | 499,044 |
| 18 | 500,352 | 500,806 | 499,535 |
| 19 | 500,919 | 499,401 | 499,837 |
| 20 | 499,593 | 498,713 | 501,025 |
The headline results
A p-value is the chance a fair die would look at least this far from perfect. Small values (near 0) would point to bias; values spread between 0 and 1 are what fair dice give. With 122 tests a few small ones are expected by chance, so each test has its own threshold from Holm's correction, between 0.000082 (0.01 ÷ 122) and 0.01, so a p-value a little under 0.01 still passes.
| Test | Mac | Windows PC | Android phone |
|---|---|---|---|
| d20, each face equally likely | Passed p = 0.099 | Passed p = 0.473 | Passed p = 0.254 |
| d6, each face equally likely | Passed p = 0.452 | Passed p = 0.532 | Passed p = 0.253 |
| d100 (percentile), each result equally likely | Passed p = 0.051 | Passed p = 0.607 | Passed p = 0.722 |
| Fate die (+, blank, −) | Passed p = 0.730 | Passed p = 0.751 | Passed p = 0.449 |
| Advantage (best of two d20s) | Passed p = 0.337 | Passed p = 0.508 | Passed p = 0.251 |
| Disadvantage (worst of two d20s) | Passed p = 0.678 | Passed p = 0.071 | Passed p = 0.069 |
| Ability scores (4d6, drop the lowest) | Passed p = 0.390 | Passed p = 0.621 | Passed p = 0.447 |
| Exploding dice (2d6!) | Passed p = 0.007 | Passed p = 0.091 | Passed p = 0.706 |
| Each d20 independent of the one before | Passed p = 0.548 | Passed p = 0.289 | Passed p = 0.213 |
| 1,000 batches of d20s: neither biased nor too good | Passed p = 0.829 | Passed p = 0.929 | Passed p = 0.471 |
Every test
We publish every test, pass or fail. Each has a threshold from Holm's correction; a test fails only when its p-value is below it. Each report gives every test's threshold.
Every face equally likely (24 tests; passed: macOS 24 of 24, Windows 24 of 24, Android 24 of 24)
| Test | Rolls | Mac p | Windows PC p | Android phone p |
|---|---|---|---|---|
| d10: every face equally likely (G-test) | 10,000,000 | 0.961 | 0.603 | 0.790 |
| d100: every face equally likely (G-test) | 10,000,000 | 0.051 | 0.607 | 0.722 |
| d12: every face equally likely (G-test) | 10,000,000 | 0.239 | 0.663 | 0.114 |
| d2: every face equally likely (G-test) | 10,000,000 | 0.729 | 0.425 | 0.032 |
| d20: every face equally likely (G-test) | 10,000,000 | 0.099 | 0.472 | 0.253 |
| d4: every face equally likely (G-test) | 10,000,000 | 0.196 | 0.206 | 0.809 |
| d6: every face equally likely (G-test) | 10,000,000 | 0.452 | 0.532 | 0.253 |
| d8: every face equally likely (G-test) | 10,000,000 | 0.465 | 0.406 | 0.756 |
| dF: every face equally likely (G-test) | 10,000,000 | 0.730 | 0.751 | 0.449 |
| d1000 for the initiative tie-break: every face equally likely (G-test) | 10,000,000 | 0.630 | 0.349 | 0.166 |
| d20 for creature initiative: every face equally likely (G-test) | 10,000,000 | 0.977 | 0.073 | 0.524 |
| d10: every face equally likely | 10,000,000 | 0.961 | 0.603 | 0.790 |
| d100: every face equally likely | 10,000,000 | 0.051 | 0.607 | 0.722 |
| d12: every face equally likely | 10,000,000 | 0.239 | 0.663 | 0.113 |
| d2: every face equally likely | 10,000,000 | 0.729 | 0.425 | 0.032 |
| d20: every face equally likely | 10,000,000 | 0.099 | 0.473 | 0.254 |
| d4: every face equally likely | 10,000,000 | 0.196 | 0.206 | 0.809 |
| d6: every face equally likely | 10,000,000 | 0.452 | 0.532 | 0.253 |
| d8: every face equally likely | 10,000,000 | 0.465 | 0.406 | 0.756 |
| dF: every face equally likely | 10,000,000 | 0.730 | 0.751 | 0.449 |
| d1000 for the initiative tie-break: every face equally likely | 10,000,000 | 0.631 | 0.349 | 0.163 |
| d20 for creature initiative: every face equally likely | 10,000,000 | 0.977 | 0.073 | 0.523 |
| d100: the tens die's digit equally likely | 10,000,000 | 0.552 | 0.477 | 0.200 |
| d100: the units die's digit equally likely | 10,000,000 | 0.096 | 0.295 | 0.116 |
Many small batches, neither biased nor too good (9 tests; passed: macOS 9 of 9, Windows 9 of 9, Android 9 of 9)
| Test | Rolls | Mac p | Windows PC p | Android phone p |
|---|---|---|---|---|
| d10: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.219 | 0.440 | 0.304 |
| d100: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.623 | 0.656 | 0.102 |
| d12: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.609 | 0.495 | 0.880 |
| d2: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.582 | 0.666 | 0.024 |
| d20: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.829 | 0.929 | 0.471 |
| d4: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.323 | 0.007 | 0.286 |
| d6: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.662 | 0.690 | 0.526 |
| d8: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.882 | 0.201 | 0.232 |
| dF: 1000 batches' p-values spread evenly (neither biased nor too good) | 10,000,000 | 0.414 | 0.200 | 0.648 |
Sums, advantage, keep and drop, exploding and Fate dice match the exact odds (14 tests; passed: macOS 14 of 14, Windows 14 of 14, Android 14 of 14)
| Test | Rolls | Mac p | Windows PC p | Android phone p |
|---|---|---|---|---|
| 1d20!: totals match the exact odds | 1,000,000 | 0.163 | 0.187 | 0.060 |
| 1d6!: totals match the exact odds | 1,000,000 | 0.856 | 0.067 | 0.959 |
| 2d20kh1: totals match the exact odds | 1,000,000 | 0.337 | 0.508 | 0.251 |
| 2d20kl1: totals match the exact odds | 1,000,000 | 0.678 | 0.071 | 0.069 |
| 2d6: totals match the exact odds | 1,000,000 | 0.776 | 0.904 | 0.080 |
| 2d6!: totals match the exact odds | 1,000,000 | 0.007 | 0.091 | 0.706 |
| 3d6: totals match the exact odds | 1,000,000 | 0.322 | 0.783 | 0.448 |
| 4d10dh1: totals match the exact odds | 1,000,000 | 0.184 | 0.507 | 0.432 |
| 4d6dl1: totals match the exact odds | 1,000,000 | 0.390 | 0.621 | 0.447 |
| 4d6kh3: totals match the exact odds | 1,000,000 | 0.066 | 0.382 | 0.196 |
| 4dF: totals match the exact odds | 1,000,000 | 0.192 | 0.556 | 0.181 |
| 4dF+1 rerolled (an invoke): totals match the exact odds | 1,000,000 | 0.471 | 0.263 | 0.563 |
| 5d8kl2: totals match the exact odds | 1,000,000 | 0.273 | 0.220 | 0.439 |
| 8d6: totals match the exact odds | 1,000,000 | 0.202 | 0.616 | 0.835 |
No roll depends on the ones before (72 tests; passed: macOS 72 of 72, Windows 72 of 72, Android 72 of 72)
| Test | Rolls | Mac p | Windows PC p | Android phone p |
|---|---|---|---|---|
| d10: gaps between top faces as chance makes them | 10,000,000 | 0.642 | 0.973 | 0.082 |
| d100: gaps between top faces as chance makes them | 10,000,000 | 0.669 | 0.207 | 0.941 |
| d12: gaps between top faces as chance makes them | 10,000,000 | 0.873 | 0.072 | 0.347 |
| d2: gaps between top faces as chance makes them | 10,000,000 | 0.539 | 0.105 | 0.144 |
| d20: gaps between top faces as chance makes them | 10,000,000 | 0.763 | 0.022 | 0.890 |
| d4: gaps between top faces as chance makes them | 10,000,000 | 0.334 | 0.056 | 0.610 |
| d6: gaps between top faces as chance makes them | 10,000,000 | 0.939 | 0.051 | 0.211 |
| d8: gaps between top faces as chance makes them | 10,000,000 | 0.795 | 0.619 | 0.992 |
| dF: gaps between top faces as chance makes them | 10,000,000 | 0.595 | 0.636 | 0.956 |
| d10: every pair of consecutive rolls equally likely | 10,000,000 | 0.860 | 0.351 | 0.749 |
| d100: every pair of consecutive rolls equally likely | 10,000,000 | 0.649 | 0.193 | 0.864 |
| d12: every pair of consecutive rolls equally likely | 10,000,000 | 0.109 | 0.098 | 0.205 |
| d2: every pair of consecutive rolls equally likely | 10,000,000 | 0.880 | 0.278 | 0.106 |
| d20: every pair of consecutive rolls equally likely | 10,000,000 | 0.574 | 0.038 | 0.584 |
| d4: every pair of consecutive rolls equally likely | 10,000,000 | 0.712 | 0.345 | 0.179 |
| d6: every pair of consecutive rolls equally likely | 10,000,000 | 0.568 | 0.263 | 0.473 |
| d8: every pair of consecutive rolls equally likely | 10,000,000 | 0.921 | 0.347 | 0.412 |
| dF: every pair of consecutive rolls equally likely | 10,000,000 | 0.436 | 0.466 | 0.445 |
| d10: runs above and below the middle as chance makes them | 10,000,000 | 0.402 | 0.181 | 0.768 |
| d100: runs above and below the middle as chance makes them | 10,000,000 | 0.871 | 0.439 | 0.165 |
| d12: runs above and below the middle as chance makes them | 10,000,000 | 0.663 | 0.494 | 0.401 |
| d2: runs above and below the middle as chance makes them | 10,000,000 | 0.758 | 0.867 | 0.995 |
| d20: runs above and below the middle as chance makes them | 10,000,000 | 0.629 | 0.178 | 0.591 |
| d4: runs above and below the middle as chance makes them | 10,000,000 | 0.330 | 0.798 | 0.192 |
| d6: runs above and below the middle as chance makes them | 10,000,000 | 0.993 | 0.071 | 0.313 |
| d8: runs above and below the middle as chance makes them | 10,000,000 | 0.369 | 0.015 | 0.171 |
| dF: runs above and below the middle as chance makes them | 10,000,000 | 0.947 | 0.193 | 0.967 |
| d10: no correlation with the roll 1 before | 10,000,000 | 0.246 | 0.317 | 0.456 |
| d100: no correlation with the roll 1 before | 10,000,000 | 0.967 | 0.505 | 0.690 |
| d12: no correlation with the roll 1 before | 10,000,000 | 0.256 | 0.968 | 0.707 |
| d2: no correlation with the roll 1 before | 10,000,000 | 0.758 | 0.866 | 0.995 |
| d20: no correlation with the roll 1 before | 10,000,000 | 0.548 | 0.289 | 0.213 |
| d4: no correlation with the roll 1 before | 10,000,000 | 0.646 | 0.656 | 0.075 |
| d6: no correlation with the roll 1 before | 10,000,000 | 0.837 | 0.207 | 0.435 |
| d8: no correlation with the roll 1 before | 10,000,000 | 0.447 | 0.104 | 0.275 |
| dF: no correlation with the roll 1 before | 10,000,000 | 0.394 | 0.043 | 0.829 |
| d10: no correlation with the roll 2 before | 10,000,000 | 0.004 | 0.633 | 0.272 |
| d100: no correlation with the roll 2 before | 10,000,000 | 0.411 | 0.784 | 0.950 |
| d12: no correlation with the roll 2 before | 10,000,000 | 0.261 | 0.070 | 0.076 |
| d2: no correlation with the roll 2 before | 10,000,000 | 0.155 | 0.017 | 0.572 |
| d20: no correlation with the roll 2 before | 10,000,000 | 0.931 | 0.735 | 0.074 |
| d4: no correlation with the roll 2 before | 10,000,000 | 0.715 | 0.154 | 0.123 |
| d6: no correlation with the roll 2 before | 10,000,000 | 0.446 | 0.426 | 0.985 |
| d8: no correlation with the roll 2 before | 10,000,000 | 0.288 | 0.616 | 0.860 |
| dF: no correlation with the roll 2 before | 10,000,000 | 0.717 | 0.480 | 0.243 |
| d10: no correlation with the roll 3 before | 10,000,000 | 0.195 | 0.908 | 0.027 |
| d100: no correlation with the roll 3 before | 10,000,000 | 0.635 | 0.406 | 0.820 |
| d12: no correlation with the roll 3 before | 10,000,000 | 0.370 | 0.802 | 0.057 |
| d2: no correlation with the roll 3 before | 10,000,000 | 0.565 | 0.404 | 0.686 |
| d20: no correlation with the roll 3 before | 10,000,000 | 0.581 | 0.403 | 0.031 |
| d4: no correlation with the roll 3 before | 10,000,000 | 0.085 | 0.158 | 0.241 |
| d6: no correlation with the roll 3 before | 10,000,000 | 0.996 | 0.227 | 0.147 |
| d8: no correlation with the roll 3 before | 10,000,000 | 0.068 | 0.450 | 0.254 |
| dF: no correlation with the roll 3 before | 10,000,000 | 0.102 | 0.478 | 0.771 |
| d10: no correlation with the roll 4 before | 10,000,000 | 0.276 | 0.826 | 0.257 |
| d100: no correlation with the roll 4 before | 10,000,000 | 0.797 | 0.532 | 0.453 |
| d12: no correlation with the roll 4 before | 10,000,000 | 0.501 | 0.039 | 0.998 |
| d2: no correlation with the roll 4 before | 10,000,000 | 0.735 | 0.245 | 0.262 |
| d20: no correlation with the roll 4 before | 10,000,000 | 0.263 | 0.806 | 0.334 |
| d4: no correlation with the roll 4 before | 10,000,000 | 0.837 | 0.933 | 0.263 |
| d6: no correlation with the roll 4 before | 10,000,000 | 0.521 | 0.250 | 0.008 |
| d8: no correlation with the roll 4 before | 10,000,000 | 0.076 | 0.346 | 0.987 |
| dF: no correlation with the roll 4 before | 10,000,000 | 0.479 | 0.532 | 0.758 |
| d10: no correlation with the roll 5 before | 10,000,000 | 0.575 | 0.723 | 0.767 |
| d100: no correlation with the roll 5 before | 10,000,000 | 0.279 | 0.383 | 0.634 |
| d12: no correlation with the roll 5 before | 10,000,000 | 0.756 | 0.216 | 0.711 |
| d2: no correlation with the roll 5 before | 10,000,000 | 0.759 | 0.124 | 0.509 |
| d20: no correlation with the roll 5 before | 10,000,000 | 0.723 | 0.419 | 0.754 |
| d4: no correlation with the roll 5 before | 10,000,000 | 0.795 | 0.856 | 0.205 |
| d6: no correlation with the roll 5 before | 10,000,000 | 0.358 | 0.288 | 0.861 |
| d8: no correlation with the roll 5 before | 10,000,000 | 0.262 | 0.964 | 0.567 |
| dF: no correlation with the roll 5 before | 10,000,000 | 0.596 | 0.385 | 0.515 |
Dice rolled together are independent (3 tests; passed: macOS 3 of 3, Windows 3 of 3, Android 3 of 3)
| Test | Rolls | Mac p | Windows PC p | Android phone p |
|---|---|---|---|---|
| 2d20: the two dice of one roll independent | 1,000,000 | 0.080 | 0.150 | 0.810 |
| 2d6: the two dice of one roll independent | 1,000,000 | 0.600 | 0.581 | 0.147 |
| 8d6: every die in the roll equally likely to show each face | 1,000,000 | 0.105 | 0.645 | 0.538 |
How we tested
The method was written down and fixed before any full run, and every run follows it:
- Each die (d2, d4, d6, d8, d10, d12, d20, d100 and the Fate die) is rolled 10,000,000 times and its counts tested with Pearson's χ² and the G-test.
- Another 10,000,000 rolls of each die, in 1,000 batches, check that results aren't too perfect, a sign of something rigged rather than random.
- Combinations: sums of several dice, advantage and disadvantage, keeping and dropping dice, exploding dice and Fate dice are each rolled 1,000,000 times and compared with their exact odds, worked out separately.
- Independence: no roll should predict the next, so we test the correlation between rolls up to five apart, every pair of rolls in a row, runs of high and low rolls, and the gaps between top faces (such as natural 20s), and that dice rolled together don't affect each other.
- One verdict for all of it: with 122 tests, some would fail by chance at the usual 1% level, so we use Holm's correction to keep the chance of any false alarm in a run at about 1%.
Each platform's run takes 217,000,000 rolls. We run it again before every release, and a release whose run fails doesn't ship: the failure is investigated, not re-rolled away.
Check it yourself
Everything behind this page is here to download. You need only Python 3, with no extra packages. Each report names where it ran only generically (the operating system, the processor type and its random source).
- Mac: full report (JSON), counts for the χ² tests (CSV)
- Windows PC: full report (JSON), counts for the χ² tests (CSV)
- Android phone: full report (JSON), counts for the χ² tests (CSV)
- The seeded run, which anyone can repeat roll for roll: report (JSON)
- The method, in full
- check_report.py recomputes every statistic from a report's raw counts, with its own formulas and its own exact odds
- reference.py is Tablelight's seeded roller rewritten in plain Python, to repeat the seeded run exactly
python3 check_report.py fairness-*-system.json
python3 reference.py seeded fairness-macos-seeded.json main:1d20
In a spreadsheet: each row of a CSV is one cell of one test (its values, the observed count and the expected count). Pearson's statistic is the sum of (observed − expected)² ÷ expected over a test's rows, and CHISQ.DIST.RT of that, with one fewer degrees of freedom than rows, gives its p-value.
What this doesn't cover
- Real dice. Players and the DM can roll their own dice and tap in the result, or roll Pixels smart dice that send it over Bluetooth. Tablelight records those faces; it doesn't roll them, so their fairness is the dice's own.
- The DM's changes. A DM may change one of their own secret rolls before showing it (never a player's). Players then see only its total, or that the DM rolled in secret. That's the DM's call, not the dice's.
- The 3D throw. It shows the result; it never chooses it (above).
- Testing and demonstration modes used while building the app, which aren't part of a game at the table.
Tablelight