Mr Goff logo

Computer Science

The relationship between 8 bit binary and 2 digit hexadecimal

An 8 bit binary number can be split in the middle into two nibbles (4 bit numbers) which you can se below with the conversion of the binary number 10100111 to hexadecimal.

Binary 128 64 32 16 8 4 2 1 Total
Value 1 0 1 0 0 1 1 1 167
Nibbles 8 4 2 1 8 4 2 1 Hexadecimal
Value 1 0 1 0 0 1 1 1
Hexdecimal 10 = A 7 A7

As you can see by splitting the number into two nibbles and treating each separately we can find each hex digit one at a time. Simply calculate the decimal value of each nibble and if the value is above 9 then convert it to the appropriate letter.

Hexadecimal to binary

Use the area below to generate a random hex number to practice converting numbers from hexadecimal to decimal.

Example

For our example let's convert the hexadecimal number 5F to it's binary equivalent.

We simply split the hex number in 2 and deal with each as its nibbles separately as can be seen below.

Hexdecimal 5 F 5F
Nibbles 8 4 2 1 8 4 2 1 Binary_value
Value 0 1 0 1 1 1 1 1 01011111

Hexadecimal to binary practice

Click the button to get a number to convert

Hexdecimal
Nibbles 8 4 2 1 8 4 2 1 Binary_value
Value

Enter the binary values for each of the nibbles and the whole 8 bit binary number above (NOTE: Do NOT leave out leading zeros).



Computer Science Home