Run the NIST SP 800-22 monobit frequency test on a bitstream sample and estimate its min-entropy per bit.
The monobit test is the first of the NIST SP 800-22 battery: it checks whether the count of ones sits inside the normal distribution expected of a fair coin, with standard deviation √n ÷ 2. Min-entropy is a stricter measure than Shannon entropy because it assumes the attacker always guesses the most likely value. A biased or stuck entropy source silently weakens every key, nonce and token derived from it, and monobit failure is the cheapest early warning that a hardware RNG or a virtualised entropy pool has degraded.
Random Number Quality
s_obs = |ones − zeros| ÷ √n and p-value = erfc(s_obs ÷ √2); the stream passes when p ≥ α.
Min-entropy estimate
min-entropy per bit = −log₂(max(p₁, 1 − p₁)), the most-likely-outcome bound.
s_obs = |ones − zeros| ÷ √n and p-value = erfc(s_obs ÷ √2); the stream passes when p ≥ α. The monobit test is the first of the NIST SP 800-22 battery: it checks whether the count of ones sits inside the normal distribution expected of a fair coin, with standard deviation √n ÷ 2. Min-entropy is a stricter measure than Shannon entropy because it assumes the attacker always guesses the most likely value.
A biased or stuck entropy source silently weakens every key, nonce and token derived from it, and monobit failure is the cheapest early warning that a hardware RNG or a virtualised entropy pool has degraded.
This calculator takes 3 inputs: Bits in the sample, Number of 1 bits observed, Significance level α. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
No. It only detects an imbalance in the overall count — an alternating 0101… stream passes perfectly. Run the full SP 800-22 battery (runs, longest-run, spectral, serial) and treat monobit as a smoke test.
SP 800-22 recommends at least 100 bits for monobit, but a meaningful assessment needs 10⁶ bits or more so the test can detect small biases.