ToolLineup

Random Binary Generator

Generate random binary strings of any bit length, optionally grouped into blocks of four or eight so they can be read at a glance. Useful for test vectors, bitmask examples, teaching material and anywhere you need a pattern with no structure in it. The bits come from the browser cryptographic random number generator rather than a pseudo-random sequence, so there is genuinely nothing to find in them. Everything is generated in your browser; nothing is uploaded and no result is recorded anywhere.

How it works

Produces a string of ones and zeros, optionally grouped for readability. Useful for test vectors, bitmask examples and teaching material.

The bits come from the cryptographic random number generator rather than a pseudo-random sequence, so there is no pattern to find in them.

Values are generated in your browser and never sent anywhere.

Generated bits

Adjust the settings above and values appear here.

Frequently asked questions

What is the grouping option for?

It inserts a space every few bits so a long string can be read. Groups of four line up with hex digits and groups of eight with bytes, which makes converting by hand much easier.

Are the bits genuinely random?

They come from the browser cryptographic random number generator, which is the same source used for keys — so there is no pattern, period or seed to recover, unlike a pseudo-random sequence.

Why do I get roughly equal numbers of ones and zeros?

Each bit is independent with an even chance either way, so the proportion converges on half as the length grows. A short string can easily be lopsided; that is expected rather than a fault.

Can I convert this to hex or decimal?

The number base converter handles binary, octal, decimal and hexadecimal at arbitrary size, and the random byte generator can show the same random data in several notations at once.

What is the maximum length?

Up to 4,096 bits per value, with as many values as you need. Longer than that and a browser page stops being the right tool for producing it.

Related tools