Randomness Lab

Pseudo Random Number Generator

Generate, visualize, compare — and build custom PRNGs. Includes format conversions & bit analysis.

Select Generators
Histogram (Primary)
Histogram (Comparison)
Write Your Own Generator

Define a function next() returning either a float 0..1 or an unsigned 32-bit integer.

// Example LCG (32-bit)
function next(){
  state = (state * 1664525 + 1013904223) >>> 0; // update state
  return state; // or return state / 2**32 for float
}
Tip: pure JS only. We sandbox with Function() (no DOM access).
Custom Output (first 200)
Custom Histogram
Convert & Inspect

Uses the most recent generated sequence (built-in or custom).

CSV uses selected format & bit width.
Bit 1’s Frequency (by position)
Shows the fraction of ones at each bit (LSB → MSB) over the full sequence.