Binary to Hex Conversion
A binary number is a number that is written using the base 2 numeral system. For example, 110 in binary represents the decimal number 6.
A Hex (Hexadecimal) number is a number written using the base 16 numeral system. The 16 hexadecimal numbers are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
The table below shows numerical representations of the first 16 digits in Decimal, Hexadecimal and Binary.
Decimal
Hexadecimal
Binary
Binary to Hex Conversion
The table above is important in performing binary to hex conversion. The binary place values are 1, 2, 4 and 8 respectively. So whenever a bit is set to 1 you simply add the place values together.
Example 1.
The binary number 110 has the place values of 4, 2, 1 with the bits representing 4 and 2 (110) set to 1. So the hexadecimal value is calculated by simply adding 4 + 2 = 6.
Example 2.
The binary number 1101 has the place values 8, 4, 2 and 1 with the bits representing 8, 4 and 1 (1101) set to 1. So the hexadecimal value is calclulated by simply adding 8 + 4 + 1 = 13 Decimal. The number 13 decimal is represented by D in hexadecimal.
Example 3.
The binary number 1000 has the place values 8, 4, 2 and 1 with only the bit representing 8 (1000) set to 1. So the hexadecimal value is 8.
Example 4.
The binary number 1010 has the place values 8, 4, 2 and 1 with the bits representing 8 and 2 (1010) set to 1. So the hexadecimal value is calculated by simply adding 8 + 2 = 10 Decimal. The number 10 decimal is represented by A in hexadecimal.
Binary to Hex Conversio n of numbers large numbers (more than 4 binary digits)
Large numbers can be grouped into 4 digit binary numbers and each grouping can be converted to hexadecimal by the same process decribed above.
Starting from the right, simply group the binary number into sets of four and calculate the Hexadecimal equivalent digit.
use the table above to calculate each grouped hexadecimal number.
Example 5.
Conver the binary number 1101010111000110 to Hexadecimal;
Answer: 1101 0101 1100 0110 (grouped into sets of 4)
= The first group of 4 numbers, 1101 = D in Hex
= The second group of 4 numbers, 0101 = 5 in Hex
= The third group of 4 numbers, 1100 = C in Hex
= The fourth group of 4 numbers, 0110 = 6 in Hex
Answer: D5C6 (Hex)
Example 6.
Convert the binary number 1101001 to Hexadecimal;
Answer: 0110 1001 (grouped into sets of 4)
= The first group of 4 numbers 0110 = 6 in Hex
= The second group of 4 numbers,1001 = 9 in Hex
Answer: 69 (Hex)
Example 7.
Convert the number 000011111 to Hexadecimal;
Answer: 0001 1111 (grouped into sets of 4)
= The first group of 4 numbers, 0001 = 1 in Hex
= The second group of 4 numbers,1111 = F in Hex
Answer: 1F (Hex)
Example 8.
Conver the number 10000000000 to Hexadecimal;
Answer: 0100 0000 0000 (grouped into sets of 4)
= The first group of 4 numbers, 0100 = 8 in Hex
= The second group of 4 numbers, 0000 = 0 in Hex
= The third group of 4 numbers, 0000 = 0 in Hex
Answer: 800 (Hex)