One digit, four bits
To convert hex to binary, replace every hex digit with its four-bit pattern. There is no arithmetic and no division.
3F = 0011 1111
A5 = 1010 0101Colors as an example
A web color such as #FF8800 is three bytes: FF, 88 and 00. In binary they are 11111111, 10001000 and 00000000, which are the red, green and blue levels from 0 to 255.
Options
- Group bits in fours: adds a space between nibbles so the result is easier to read.
- Pad to whole bytes: adds zeros on the left until the length is a multiple of 8.
- Remove leading zeros: shortens the result, so 0F becomes 1111.
- 0b prefix: writes 0b in front, as many languages expect.
Hex bytes as text
If your hex is a series of bytes, the tool also tries to read it as UTF-8 text. The hex 48 65 6C 6C 6F is the text Hello. If the bytes are not valid text, it says so. A prefix such as 0x, a leading # and spaces are all accepted.
Batch conversion
Paste one hex number per line in the list box to convert many at once.
For the reverse direction, use binary to hex. To see the decimal value, try binary to decimal. The guide to binary numbers explains the system from the start.