Flip a fair coin once, or run batch simulations of up to 1,000,000 flips. See running heads/tails counts, the longest same-side streak, and a chi-square fairness test. Uses crypto.getRandomValues for unbiased randomness.
The chi-square statistic compares observed counts to the expected 50/50 split: χ² = (H − N/2)² / (N/2) + (T − N/2)² / (N/2). With 1 degree of freedom, a value above 3.84 is statistically significant at p < 0.05 — suggesting bias, though at small N this happens by chance. Longest run counts the longest streak of identical consecutive outcomes.