Numbers

Binary & Hex Number Generator

Generate a random number and see it side-by-side in decimal, binary, and hexadecimal — great practice for computer science and programming students.

Cryptographically secure Instant, in your browser Free, no sign-up

Generate

Your result will appear here

How the Binary & Hex Number Generator works

This tool draws a single random integer and displays it in the three number bases most relevant to programming: decimal (base 10, everyday counting), binary (base 2, the representation computers use internally), and hexadecimal (base 16, a common compact way to write binary-aligned values like colors and memory addresses).

It's built for quick, repeatable practice — generate a new random value, try converting it in your head or on paper between bases, and check your work instantly against Xrandom's conversion.

How to use it

1
Set a decimal range255 as a maximum is a natural fit if you're practicing single-byte values.
2
GenerateXrandom draws one random decimal integer and instantly converts it to binary and hexadecimal.
3
Practice conversionsCover up two of the three columns and try converting from the one you can see, then check your answer.

Frequently asked questions

Why is 255 a common maximum to use?

255 (0-255) is the full range of an 8-bit byte, a very common unit in programming — its binary form is exactly 8 digits and its hex form exactly 2 digits.

Can I use negative numbers?

No, this tool works with non-negative integers to keep binary and hex representations straightforward and unsigned.

What's the largest value supported?

Very large integers work, though binary representations get long fast — for teaching purposes, ranges under a few thousand are easiest to work with by hand.