CCENT (ICND1)ManagementNetworking 101

How to convert Hexadecimal into Decimal

Hex or Hexadecimal, is a 16-base number system with values from 0-9 as well as ABCDEF where A=10, B=11, C=12, D=13, E=14, F=15.

Hex is used in many things in IT, most commonly seen in Mac addresses (A unique identity number on every Network Card).

It is also seen in certain features such as HSRP (Hot Standby Routing Protocol) group numbers.

 

This section is here to help understand how to convert Hex into Binary, and Binary into Decimal and of course the reverse.

 

Let’s begin with the easy one, the reverse… If I have the number 47 and wanted to convert that into Hexadecimal, the easiest way is to first put it into Binary.

 

Using our binary table (as described in the post “How to count in Binary” ) we see the binary value is 00101111

 

128         64            32           16           8              4              2              1

0              0              1            0            1              1              1              1

 

 

Hex is not that much harder to get to from here, but what we need to do is break up the byte (8 bits) into 2 halves of 4 bits each. And draw a new table above each of the 4 bits (as seen below)

 

8              4              2              1                                   8              4              2              1

0              0              1              0                                   1              1              1              1

 

 

You will notice that the above Binary is the same as it was in the first table, however I’ve split the 8 bits in half and created 2 new groups of 4 bits each.

If we look at the first group we see that only the 2 has been turned on which results in the value been equal to ‘2’

In the second group, the 8 and 4 and 2 and 1 have all been turned on which results in the value been equal to ’15’ (8+4+2+1)

 

So we currently have 2 (from the first group) and 15 (from the second group). 2 is a valid number in Hex so it remains exactly the same however 15 is represented in Hex as ‘F’

Therefore 47 in Decimal is equal to 2F in Hexadecimal.

 

 

So what if we had the Hex value and wanted to get it back to Decimal, let’s look at the value 4C.

We know that ‘4’ is a valid Hex value, and we now know that ‘C’ is a representation of ’12’ in Hex.

Working backwards we need to create 2 tables of 4 bits each, and fill ‘4’ into the first table, and ’12’ into the second

 

8              4              2              1                                8              4              2              1

0              1              0              0                                1              1              0              0

 

After we have done this, we now need to re-join the 2 halves back into a single 8 bit structure

 

128         64            32           16           8              4              2              1

0              1              0            0            1              1              0              0

 

And if we add up all our “On” bits, we have (64+8+4=76)

Therefore 4C in Hexadecimal is equal to 76 in decimal

4 thoughts on “How to convert Hexadecimal into Decimal

  1. Hi Roman,

    No it won’t change. The MAC address is bound to your network card, so only if you changed the network card would the MAC address change.

    Hope this helps,
    Regards,
    Jay

  2. Thanks man you saved my day. We are doing hex convert at my class and i did´t get it. Now i do 🙂
    About the question above. Doesnt each single part of hardware have a unique mac address?

    1. Hi Mike,

      MAC addresses are used for network interfaces, so all devices that “do” networking will have a MAC address, this includes your WiFi interface, Blue Tooth, LAN etc.

      Regards,
      Jay

Leave a Reply

Your email address will not be published. Required fields are marked *