Random Binary Numbers Generator

Generate strings of zeros and ones with the count and bit length you choose. Copy the results or download a text file.

1 to 10,000 values, 1 to 256 bits each. Up to 500,000 bits total.

Choose a Count and Bit Length

Set the number of values and the number of bits in each value, then press Generate binary values. The page starts with five lines of 32 bits each. Every line contains only 0 and 1, and each line has the length you chose.

You can request 1 to 10,000 values with 1 to 256 bits per value. The combined output is limited to 500,000 bits so a large request does not freeze the page. If you reach that limit, reduce either the count or the length and generate again.

How to Read a Binary Value

Binary uses two digits, 0 and 1. Each position is a bit. For example, 1011 has four bits and represents 11 in decimal when read as an unsigned binary number. The same four positions could mean something else in a program, such as four on/off flags.

The generator keeps leading zeros so every line stays the requested length. With eight bits, 00001011 and 1011 have the same unsigned numeric value, but they are different strings. That distinction matters when testing input fields or fixed-width data.

Make Useful Test Data

Short values are easy to compare by eye. Try four or eight bits when teaching place values, testing a parser, or checking that a form rejects characters other than 0 and 1. Longer values can help you test fixed-width fields and files that expect many bits per record.

Each bit is picked independently. Two lines can be identical, especially when the length is short. For example, there are only four possible two-bit strings: 00, 01, 10, and 11. Asking for more than four two-bit results must produce repeats.

Copy or Download the List

Copy results puts all lines on your clipboard. Download text file saves the same output as a plain text file, with one value per line. Generating again replaces the current list, so copy or download it first if you need to keep it.

The output is text. A 256-bit line appears as 256 visible characters, not as a packed 32-byte file. If a program expects raw bytes, you will need to convert the text in that program.

Use the Right Tool for the Job

This page uses browser Math.random() to make sample bit strings. It is useful for lessons, examples, and ordinary software tests. It is not a cryptographic key generator, so do not use these strings as passwords, encryption keys, or other secrets.

For values in a decimal range, use the Random Number Generator. For formatted identifiers, try the Random UUID Generator.

Frequently Asked Questions

Leading zeros count toward the chosen length. They let every result have the same number of bits.

No. Every bit is picked independently, and the tool does not remove duplicate lines. Short values have fewer possible combinations, so repeats are more common.

No. It is a text file containing the characters 0 and 1, with one generated value on each line.

Recently Updated Pages