Guides › Minimum sequence length
SP 800-22 minimum sequence length for each test
Short answer: use 1,000,000 bits (125,000 bytes) per sequence. Below that, some tests cannot run and report N/A. The table shows exactly where each test starts working.
Bits needed per test
"Minimum here" is the length below which NISTTEST.COM reports N/A for that test. The NIST column summarises the parameter guidance in SP 800-22 Rev. 1a section 2, where n is the sequence length in bits.
| Test | Minimum here (bits) | As .bin (bytes) | NIST guidance |
|---|---|---|---|
| 1. Frequency (Monobit) | 100 | 13 | n ≥ 100 |
| 2. Frequency within a Block | 2,560 | 320 | n ≥ 100, block size M ≥ 20, M > 0.01n, fewer than 100 blocks |
| 3. Runs | 100 | 13 | n ≥ 100 |
| 4. Longest Run of Ones | 128 | 16 | Block size 8 from 128 bits, 128 from 6,272 bits, 10,000 from 750,000 bits |
| 5. Binary Matrix Rank | 38,912 | 4,864 | n ≥ 38·M·Q with 32×32 matrices |
| 6. Discrete Fourier Transform | 1,000 | 125 | n ≥ 1,000 |
| 7. Non-overlapping Template | 8,256 | 1,032 | Template length 9 or 10, at most 100 blocks |
| 8. Overlapping Template | 1,000,000 | 125,000 | n ≥ 106 |
| 9. Maurer's Universal | 387,840 | 48,480 | n ≥ 387,840 for block length L = 6; longer for larger L |
| 10. Linear Complexity | 100,000 | 12,500 | n ≥ 106 recommended, block size 500–5,000, at least 200 blocks |
| 11. Serial | 262,144 | 32,768 | Pattern length m < ⌊log2 n⌋ − 2 (m = 16 here) |
| 12. Approximate Entropy | 2,048 | 256 | Pattern length m < ⌊log2 n⌋ − 5 (m = 10 here) |
| 13. Cumulative Sums | 100 | 13 | n ≥ 100 |
| 14. Random Excursions | 1,000,000 | 125,000 | n ≥ 106 and at least 500 cycles |
| 15. Random Excursions Variant | 1,000,000 | 125,000 | n ≥ 106 and at least 500 cycles |
Why the Random Excursions tests still say N/A at a million bits
These two tests look at the random walk formed by adding +1 for each one and −1 for each zero, and split it into cycles that start and end at zero. They need at least 500 cycles. A random million-bit sequence has about 800 cycles on average, but the count varies a lot: in our simulations roughly a third of random million-bit sequences had fewer than 500, so these two tests reported N/A. Longer sequences help only slowly (about a quarter still fall short at 2 million bits, about a fifth at 4 million). N/A here says nothing bad about your generator.
Binary files are eight times smaller than text
In a .bin file each byte holds 8 bits. In a .txt file of 0 and 1 characters, each character is a whole byte holding one bit. The same 1,000,000-bit sequence is:
- 125,000 bytes (about 122 KB) as
.bin, which fits within the 500 KB free test here; - 1,000,000 bytes (about 977 KB) as ASCII text, above the free limit.
Convert text to binary before uploading if you can; the input file guide shows how.
How many sequences?
One sequence tells you whether that capture shows a weakness. To judge a generator, SP 800-22 tests many sequences and checks the pass proportion and the spread of p-values; NIST suggests at least 55 sequences for the uniformity check (how the proportion and uniformity checks work).
Check which tests your file can run. Upload it and the results table marks every test that needs more data.
Run the free testNISTTEST.COM is an independent implementation of NIST SP 800-22 Rev. 1a and is not affiliated with or endorsed by the National Institute of Standards and Technology.