Binary and hexadecimal

<< Previous: Hexadecimal Next: Binary maths >>

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

Binary to hexadecimal

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

Example

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

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

Nibbles 8 4 2 1 8 4 2 1 Binary_value
Value 1 0 1 1 0 0 1 1 10110011
Hexdecimal 11 = B 3 B3

Test yourself

Click the button to get a number to convert

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

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



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=15 5F
Nibbles 8 4 2 1 8 4 2 1 Binary_value
Value 0 1 0 1 1 1 1 1 01011111

Test yourself

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



<< Previous: Hexadecimal Next: Binary maths >>

© All materials created by and copyright S.Goff