TestU01
TestU01 is a free software library written in ANSI C for testing the randomness of random-number generators (RNGs). It was introduced in 2007 by Pierre L’Ecuyer and Richard Simard of Université de Montréal. The library can test many RNGs, including ones described in research and ones used in software. It provides the classical statistical tests for randomness, plus many additional and original tests. You can run tests on RNGs built into the library, on your own generators, or on sequences stored in files. There are test suites for uniform numbers in [0,1] and for raw bit streams, and the library also includes simple plotting tools.
Historically, randomness testing started with Knuth’s tests in 1969 and was later expanded by Marsaglia’s Diehard tests (1996), which had 15 tests but were hard to modify. TestU01 offers four groups of analysis modules and lets researchers study how test results depend on the interaction between a test and the structure of a generator’s output. This helps determine how large a sample should be, given the generator’s period, before failures are likely.
TestU01 includes several test batteries: Small Crush (10 tests), Crush (96 tests), and Big Crush (106 tests). The exact tests in each battery are described in the user guide. On a typical PC, running times vary: a simple RNG might take about 2 minutes for Small Crush, about 1.7 hours for Crush, and about 4 hours for Big Crush (larger or more complex RNGs take longer). Diehard tests are much faster, usually around 15 seconds.
Note: TestU01 accepts 32-bit inputs and interprets them as values in [0,1], making it more sensitive to flaws in the most-significant bits. To check low-order bits, it’s important to test generators in bit-reversed form. For RNGs that produce 64-bit outputs, separate tests should be run for the high and low halves.
This page was last edited on 2 February 2026, at 10:12 (CET).