Are the dice fair?

Tested 24 November 2026, on a Mac, a Windows PC and an Android phone, at Tablelight build 427e4d9e9c9d (our internal reference for the code tested). Method version 1.

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.

10,000,000 d20 rolls on the Mac, by faceTwenty bars, one per face, beside a dashed line at a perfect share of 500,000. The face furthest from its share is 7, 0.43% (3.1 standard deviations) under. With 20 faces, fair dice put one face that far out about 4 times in 100 runs, which is why the test weighs all the faces together. The table below the chart has every count.0250,000500,0001: 500,773 rolls (+0.15% from 500,000)12: 501,211 rolls (+0.24% from 500,000)23: 500,555 rolls (+0.11% from 500,000)34: 499,107 rolls (-0.18% from 500,000)45: 499,475 rolls (-0.10% from 500,000)56: 498,874 rolls (-0.23% from 500,000)67: 497,858 rolls (-0.43% from 500,000)78: 499,893 rolls (-0.02% from 500,000)89: 500,298 rolls (+0.06% from 500,000)910: 500,881 rolls (+0.18% from 500,000)1011: 500,111 rolls (+0.02% from 500,000)1112: 499,973 rolls (-0.01% from 500,000)1213: 498,867 rolls (-0.23% from 500,000)1314: 500,280 rolls (+0.06% from 500,000)1415: 500,852 rolls (+0.17% from 500,000)1516: 499,744 rolls (-0.05% from 500,000)1617: 500,384 rolls (+0.08% from 500,000)1718: 500,352 rolls (+0.07% from 500,000)1819: 500,919 rolls (+0.18% from 500,000)1920: 499,593 rolls (-0.08% from 500,000)20dashed line: a perfect share, 500,000 eachface
Pearson's χ² = 27.3 on 19 degrees of freedom, p = 0.099. The face furthest from its share is 7, 0.43% (3.1 standard deviations) under. With 20 faces, fair dice put one face that far out about 4 times in 100 runs, which is why the test weighs all the faces together.

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.

How far each face is from a perfect share, in standard deviations (Mac)Each face's count minus 500,000, divided by the standard deviation chance gives it (689 rolls). Bars between −2 and +2 are what chance looks like.-4-20+2+41: +773 rolls, +1.12 standard deviations12: +1,211 rolls, +1.76 standard deviations23: +555 rolls, +0.81 standard deviations34: -893 rolls, -1.30 standard deviations45: -525 rolls, -0.76 standard deviations56: -1,126 rolls, -1.63 standard deviations67: -2,142 rolls, -3.11 standard deviations78: -107 rolls, -0.16 standard deviations89: +298 rolls, +0.43 standard deviations910: +881 rolls, +1.28 standard deviations1011: +111 rolls, +0.16 standard deviations1112: -27 rolls, -0.04 standard deviations1213: -1,133 rolls, -1.64 standard deviations1314: +280 rolls, +0.41 standard deviations1415: +852 rolls, +1.24 standard deviations1516: -256 rolls, -0.37 standard deviations1617: +384 rolls, +0.56 standard deviations1718: +352 rolls, +0.51 standard deviations1819: +919 rolls, +1.33 standard deviations1920: -407 rolls, -0.59 standard deviations20face
The shaded band is ±2 standard deviations, where chance puts about 19 faces in 20.
The counts, face by face
FaceMacWindows PCAndroid phone
1500,773500,114500,069
2501,211499,117501,129
3500,555500,780499,436
4499,107499,289499,826
5499,475500,669499,526
6498,874499,583500,719
7497,858500,793499,748
8499,893500,802499,752
9500,298499,690500,745
10500,881499,774497,812
11500,111500,056500,142
12499,973499,287500,453
13498,867499,239500,418
14500,280500,901499,842
15500,852500,660500,020
16499,744499,730500,922
17500,384500,596499,044
18500,352500,806499,535
19500,919499,401499,837
20499,593498,713501,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.

TestMacWindows PCAndroid phone
d20, each face equally likelyPassed p = 0.099Passed p = 0.473Passed p = 0.254
d6, each face equally likelyPassed p = 0.452Passed p = 0.532Passed p = 0.253
d100 (percentile), each result equally likelyPassed p = 0.051Passed p = 0.607Passed p = 0.722
Fate die (+, blank, −)Passed p = 0.730Passed p = 0.751Passed p = 0.449
Advantage (best of two d20s)Passed p = 0.337Passed p = 0.508Passed p = 0.251
Disadvantage (worst of two d20s)Passed p = 0.678Passed p = 0.071Passed p = 0.069
Ability scores (4d6, drop the lowest)Passed p = 0.390Passed p = 0.621Passed p = 0.447
Exploding dice (2d6!)Passed p = 0.007Passed p = 0.091Passed p = 0.706
Each d20 independent of the one beforePassed p = 0.548Passed p = 0.289Passed p = 0.213
1,000 batches of d20s: neither biased nor too goodPassed p = 0.829Passed p = 0.929Passed 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)
TestRollsMac pWindows PC pAndroid phone p
d10: every face equally likely (G-test)10,000,0000.9610.6030.790
d100: every face equally likely (G-test)10,000,0000.0510.6070.722
d12: every face equally likely (G-test)10,000,0000.2390.6630.114
d2: every face equally likely (G-test)10,000,0000.7290.4250.032
d20: every face equally likely (G-test)10,000,0000.0990.4720.253
d4: every face equally likely (G-test)10,000,0000.1960.2060.809
d6: every face equally likely (G-test)10,000,0000.4520.5320.253
d8: every face equally likely (G-test)10,000,0000.4650.4060.756
dF: every face equally likely (G-test)10,000,0000.7300.7510.449
d1000 for the initiative tie-break: every face equally likely (G-test)10,000,0000.6300.3490.166
d20 for creature initiative: every face equally likely (G-test)10,000,0000.9770.0730.524
d10: every face equally likely10,000,0000.9610.6030.790
d100: every face equally likely10,000,0000.0510.6070.722
d12: every face equally likely10,000,0000.2390.6630.113
d2: every face equally likely10,000,0000.7290.4250.032
d20: every face equally likely10,000,0000.0990.4730.254
d4: every face equally likely10,000,0000.1960.2060.809
d6: every face equally likely10,000,0000.4520.5320.253
d8: every face equally likely10,000,0000.4650.4060.756
dF: every face equally likely10,000,0000.7300.7510.449
d1000 for the initiative tie-break: every face equally likely10,000,0000.6310.3490.163
d20 for creature initiative: every face equally likely10,000,0000.9770.0730.523
d100: the tens die's digit equally likely10,000,0000.5520.4770.200
d100: the units die's digit equally likely10,000,0000.0960.2950.116
Many small batches, neither biased nor too good (9 tests; passed: macOS 9 of 9, Windows 9 of 9, Android 9 of 9)
TestRollsMac pWindows PC pAndroid phone p
d10: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.2190.4400.304
d100: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.6230.6560.102
d12: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.6090.4950.880
d2: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.5820.6660.024
d20: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.8290.9290.471
d4: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.3230.0070.286
d6: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.6620.6900.526
d8: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.8820.2010.232
dF: 1000 batches' p-values spread evenly (neither biased nor too good)10,000,0000.4140.2000.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)
TestRollsMac pWindows PC pAndroid phone p
1d20!: totals match the exact odds1,000,0000.1630.1870.060
1d6!: totals match the exact odds1,000,0000.8560.0670.959
2d20kh1: totals match the exact odds1,000,0000.3370.5080.251
2d20kl1: totals match the exact odds1,000,0000.6780.0710.069
2d6: totals match the exact odds1,000,0000.7760.9040.080
2d6!: totals match the exact odds1,000,0000.0070.0910.706
3d6: totals match the exact odds1,000,0000.3220.7830.448
4d10dh1: totals match the exact odds1,000,0000.1840.5070.432
4d6dl1: totals match the exact odds1,000,0000.3900.6210.447
4d6kh3: totals match the exact odds1,000,0000.0660.3820.196
4dF: totals match the exact odds1,000,0000.1920.5560.181
4dF+1 rerolled (an invoke): totals match the exact odds1,000,0000.4710.2630.563
5d8kl2: totals match the exact odds1,000,0000.2730.2200.439
8d6: totals match the exact odds1,000,0000.2020.6160.835
No roll depends on the ones before (72 tests; passed: macOS 72 of 72, Windows 72 of 72, Android 72 of 72)
TestRollsMac pWindows PC pAndroid phone p
d10: gaps between top faces as chance makes them10,000,0000.6420.9730.082
d100: gaps between top faces as chance makes them10,000,0000.6690.2070.941
d12: gaps between top faces as chance makes them10,000,0000.8730.0720.347
d2: gaps between top faces as chance makes them10,000,0000.5390.1050.144
d20: gaps between top faces as chance makes them10,000,0000.7630.0220.890
d4: gaps between top faces as chance makes them10,000,0000.3340.0560.610
d6: gaps between top faces as chance makes them10,000,0000.9390.0510.211
d8: gaps between top faces as chance makes them10,000,0000.7950.6190.992
dF: gaps between top faces as chance makes them10,000,0000.5950.6360.956
d10: every pair of consecutive rolls equally likely10,000,0000.8600.3510.749
d100: every pair of consecutive rolls equally likely10,000,0000.6490.1930.864
d12: every pair of consecutive rolls equally likely10,000,0000.1090.0980.205
d2: every pair of consecutive rolls equally likely10,000,0000.8800.2780.106
d20: every pair of consecutive rolls equally likely10,000,0000.5740.0380.584
d4: every pair of consecutive rolls equally likely10,000,0000.7120.3450.179
d6: every pair of consecutive rolls equally likely10,000,0000.5680.2630.473
d8: every pair of consecutive rolls equally likely10,000,0000.9210.3470.412
dF: every pair of consecutive rolls equally likely10,000,0000.4360.4660.445
d10: runs above and below the middle as chance makes them10,000,0000.4020.1810.768
d100: runs above and below the middle as chance makes them10,000,0000.8710.4390.165
d12: runs above and below the middle as chance makes them10,000,0000.6630.4940.401
d2: runs above and below the middle as chance makes them10,000,0000.7580.8670.995
d20: runs above and below the middle as chance makes them10,000,0000.6290.1780.591
d4: runs above and below the middle as chance makes them10,000,0000.3300.7980.192
d6: runs above and below the middle as chance makes them10,000,0000.9930.0710.313
d8: runs above and below the middle as chance makes them10,000,0000.3690.0150.171
dF: runs above and below the middle as chance makes them10,000,0000.9470.1930.967
d10: no correlation with the roll 1 before10,000,0000.2460.3170.456
d100: no correlation with the roll 1 before10,000,0000.9670.5050.690
d12: no correlation with the roll 1 before10,000,0000.2560.9680.707
d2: no correlation with the roll 1 before10,000,0000.7580.8660.995
d20: no correlation with the roll 1 before10,000,0000.5480.2890.213
d4: no correlation with the roll 1 before10,000,0000.6460.6560.075
d6: no correlation with the roll 1 before10,000,0000.8370.2070.435
d8: no correlation with the roll 1 before10,000,0000.4470.1040.275
dF: no correlation with the roll 1 before10,000,0000.3940.0430.829
d10: no correlation with the roll 2 before10,000,0000.0040.6330.272
d100: no correlation with the roll 2 before10,000,0000.4110.7840.950
d12: no correlation with the roll 2 before10,000,0000.2610.0700.076
d2: no correlation with the roll 2 before10,000,0000.1550.0170.572
d20: no correlation with the roll 2 before10,000,0000.9310.7350.074
d4: no correlation with the roll 2 before10,000,0000.7150.1540.123
d6: no correlation with the roll 2 before10,000,0000.4460.4260.985
d8: no correlation with the roll 2 before10,000,0000.2880.6160.860
dF: no correlation with the roll 2 before10,000,0000.7170.4800.243
d10: no correlation with the roll 3 before10,000,0000.1950.9080.027
d100: no correlation with the roll 3 before10,000,0000.6350.4060.820
d12: no correlation with the roll 3 before10,000,0000.3700.8020.057
d2: no correlation with the roll 3 before10,000,0000.5650.4040.686
d20: no correlation with the roll 3 before10,000,0000.5810.4030.031
d4: no correlation with the roll 3 before10,000,0000.0850.1580.241
d6: no correlation with the roll 3 before10,000,0000.9960.2270.147
d8: no correlation with the roll 3 before10,000,0000.0680.4500.254
dF: no correlation with the roll 3 before10,000,0000.1020.4780.771
d10: no correlation with the roll 4 before10,000,0000.2760.8260.257
d100: no correlation with the roll 4 before10,000,0000.7970.5320.453
d12: no correlation with the roll 4 before10,000,0000.5010.0390.998
d2: no correlation with the roll 4 before10,000,0000.7350.2450.262
d20: no correlation with the roll 4 before10,000,0000.2630.8060.334
d4: no correlation with the roll 4 before10,000,0000.8370.9330.263
d6: no correlation with the roll 4 before10,000,0000.5210.2500.008
d8: no correlation with the roll 4 before10,000,0000.0760.3460.987
dF: no correlation with the roll 4 before10,000,0000.4790.5320.758
d10: no correlation with the roll 5 before10,000,0000.5750.7230.767
d100: no correlation with the roll 5 before10,000,0000.2790.3830.634
d12: no correlation with the roll 5 before10,000,0000.7560.2160.711
d2: no correlation with the roll 5 before10,000,0000.7590.1240.509
d20: no correlation with the roll 5 before10,000,0000.7230.4190.754
d4: no correlation with the roll 5 before10,000,0000.7950.8560.205
d6: no correlation with the roll 5 before10,000,0000.3580.2880.861
d8: no correlation with the roll 5 before10,000,0000.2620.9640.567
dF: no correlation with the roll 5 before10,000,0000.5960.3850.515
Dice rolled together are independent (3 tests; passed: macOS 3 of 3, Windows 3 of 3, Android 3 of 3)
TestRollsMac pWindows PC pAndroid phone p
2d20: the two dice of one roll independent1,000,0000.0800.1500.810
2d6: the two dice of one roll independent1,000,0000.6000.5810.147
8d6: every die in the roll equally likely to show each face1,000,0000.1050.6450.538

How we tested

The method was written down and fixed before any full run, and every run follows it:

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).

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

Questions about the tests? Email hello@tablelight.app.