How to use the random binary generator
- Choose the Base: Binary, Octal, Decimal or Hexadecimal.
- Set Digits, the length of each string, from 1 to 4,096.
- Set Group every to put a space after that many digits. Use 0 for no spaces.
- Enter How many strings you need (1 to 200), and tick No leading zero if the first digit must not be 0.
- Press Generate and use Copy all to take the whole list.
What it does and when to use it
Use it to make test data: random bit patterns for a digital-logic exercise, hex strings that look like IDs or keys, octal values for permission puzzles, or long digit strings for a parser test. Teachers can generate a set of binary numbers for students to convert by hand and then check them with the binary calculator.
For ready-made identifiers in a standard format, use the UUID generator. To turn binary back into readable text, try binary to text. For numbers in a range rather than fixed-length strings, use the random number generator.
How it works
Each digit is drawn on its own from the digits allowed in the base: 0–1, 0–7, 0–9 or 0–9 and a–f. The draw uses crypto.getRandomValues with rejection sampling, so every digit is equally likely and there is no bias towards small values. Grouping only adds spaces for reading; it does not change the digits.
The bits figure is the length times log₂ of the base. It tells you how many guesses an attacker would need in the worst case: 2 to the power of the bits.
Worked examples
16 binary digits in groups of 4 (the default). One run gave 1100 0001 0101 0011. Each string holds 16 bits of randomness.
8 hex digits, no grouping. One run gave 9d6d694c and 7859ae6d, each worth 32 bits.
6 decimal digits. Each string is worth 6 × 3.32 ≈ 19.9 bits, which matches the one-in-a-million chance of guessing a 6-digit code.
Limits and tips
- Strings are capped at 4,096 digits and 200 per press.
- Values with a leading zero, such as 0042, are valid strings but may lose the zero when pasted into a spreadsheet; format the column as text first.
- Strings are made on your device and are not stored or sent anywhere.
Frequently asked questions
How is "Randomness per string" worked out?
Are these strings safe to use as secret tokens?
What does No leading zero do?
Are hex letters upper or lower case?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.