Another way data is stored is in hex

To convert an integer to hexadecimal

First convert a in integer into binary

We will convert 155 to 10011011

Create two tables both four bits:

8421
8421

Place the first four bits of 10010011 into the first table and the last four bits into the second table:

8421
1001
8421
1011

Total the value from the two tables:

Table 1 (8+1) = 9

Table 2 (8+2+1) = 11

Convert the value to hex using the table:

ValueHex
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F

From the first table we get 9 and from the second table we get B

Join the two to get a hex value in this case 155 = 9B


Convert Hex to integer

We will convert D7 into an integer

Separate the two characters to D and 7

Find the corresponding value

ValueHex
11
22
33
44
55
66
77
88
99
10A
11B
12C
13D
14E
15F

D = 13

7=7

Change 13 into binary

13 = 1101

Change 7 into binary

7 = 0111

Join the two binary values together to get 11010111

Convert binary into denary

11010111 = 215

Scroll to Top