Why this uses the same randomness as a password generator, not Math.random#
Most "dice roller" tools reach for JavaScript's Math.random, a fast pseudorandom generator with a predictable internal algorithm — perfectly fine for a UI animation, not genuinely unpredictable in the way an actual dice roll should be. This tool uses crypto.getRandomValues instead, the operating system's cryptographically secure random source, with rejection sampling to guarantee every face is exactly equally likely rather than very slightly biased toward lower numbers, the way a naive modulo-based approach would be.
Why it isn't limited to 6-sided dice#
A "die" here just means a uniformly random number between 1 and however many sides you set — a standard d6, a d20 for a tabletop game, a d100 for a percentile roll, or any other number entirely. The sides field is a plain number, not a dropdown of preset shapes, so anything from a coin flip (2 sides) up is supported without needing a special mode for each one.
Why both individual rolls and the total are shown#
Some uses only care about the sum (rolling several dice for a combined damage total, for instance); others need to see each individual result (checking for doubles, or reading results off one die at a time). Both are shown together so either use is covered without needing a separate mode.