How it works
This hexadecimal random number generator draws a whole number, every value equally likely, and writes it in base 16. Leading zeros stay, so ten is 0A and not A. The table under the tool gives the worth of each digit.
Read the full guide
How to read a hex number
Say the result is B2. The right digit counts ones and the left digit counts sixteens. In the table B is eleven, so B2 = 11 × 16 + 2 = 178. With four digits the places are worth 4,096, 256, 16 and 1.
Generate a random hex number of 4 or 6 digits
After the first draw, tap 4 digits for 0000 to FFFF or 6 digits for 000000 to FFFFFF, the length of a web color code. How many gives several at once.
Tips
- One hex digit is four bits, so two digits make a byte: F is 1111 and FF is 1111 1111.
Questions and answers
What do the letters A to F mean in hexadecimal?
They are digits. Base 16 needs sixteen of them and there are only ten numerals, so A stands for ten, B eleven, C twelve, D thirteen, E fourteen and F fifteen.
How many values can a 2-digit hex number have?
256, from 00 to FF, because 16 × 16 = 256. Four digits give 65,536 values and six digits give 16,777,216.
Is every hex number equally likely?
Yes. The page draws one whole number from the range, each with the same chance, and then writes it in base 16. That suits test data and lessons, not passwords or keys.