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.
Generate
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
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.