When you are dealing with MAC addresses or IP addresses, it is very likely that you will be dealing with hexadecimal numbers at some point.
However, humans are not used to think in hexadecimal, it is easier for us to deal with decimal numbers.
Hexadecimal, as its name describes, is a representation of a number in base 16, meaning in powers of 16.
On the other hand, decimal numbers are represented in base 10 and they are the numbers that you used to calculate with.
In this tutorial, we are going to see how you can convert hexadecimal numbers to decimal.
Convert Hexadecimal To Decimal
In order to convert an hexadecimal to decimal, you have to follow those steps :
- Write down your hexadecimal number;
- For the very first digital on the right, multiply 16 at the power of zero (the “power”) with the decimal equivalent of your hexadecimal number;
- Repeat the operation for all the numbers, incrementing the “power” by one on every digit;
- In the end, sum up all the numbers of the previous steps.
Congratulations, you successfully converted your hexadecimal number to a decimal number!
As an example speaks a thousand words, let’s see how you can convert an hexadecimal MAC address to decimal.
Convert Hexadecimal MAC Address to Decimal
For this example, we are going to take a MAC address linked to the Cisco vendor : A4-B4-39.
First, let’s get rid of the hyphens and write the hexadecimal number down : A4B439.
As the first section explains, we start with the first number on the right, which is 9.
We multiply 9 by 16 to the power of zero : 9*16^0 = 9 because 16^0 is equal to 1.
Then, let’s continue with the second number, which is 3 : 3*16^1 = 48.
As you can see, in the second step, we incremented the “power”, it went from 0 to 1.
We are going to increment “the power” on every single digit.
The third number follows the same logic : 4*16^2 = 1024.
For the fourth digit, we have to find the decimal equivalent for the “B” letter.
How can we achieve that?
Finding the decimal equivalent for a hexadecimal number
In order to find the decimal equivalent for a hexadecimal number, you have to follow the following table.
Decimal Number | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Hexadecimal digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | 10 (1+0) |
Going back to our previous example, we have to look the letter “B” which is equivalent to 11 in decimal.
As a consequence, for B, in our MAC address, we would write : 11*16^3 = 45056.
Continuing until the last digit, we have 4*16^4 = 262144 and 10 (the equivalent of A) * 16^5 = 10485760.
As you can imagine, the numbers keep on growing as the powers of 16 are incremented.
Summing every number and finding the decimal number
Now, to finally convert the hexadecimal MAC address to a decimal MAC, we need to sum all the individual numbers :
10485760 + 262144 + 45056 + 1024 + 48 + 9 = 10 794 041!
Congratulations, you successfully converted your hexadecimal number to decimal!
Hexadecimal Conversions Exercises
There are no better ways to become great at something than exercising yourself at it.
For the second example, let’s take the MAC Address 10-5B-AD and convert it to decimal.
First, again, we write down the hexadecimal number without any hyphens : 105BAD.
Starting from the right, we multiply the first digit (D is equivalent to 13) by 16 to the power of zero : 13*16^0 = 13.
On the second digital, we find its decimal equivalent (A is equivalent to 10) and we multiply it by 16 to the power of one.
For the third digit, again, we need to convert B to its decimal equivalent, which is 11. Then, we multiply it by 16 to the power of two : 11*16^2 = 2816.
Without detailing the other steps, which are pretty similar to the previous one, we found that we need to sum the following numbers :
1048576 + 0 + 20480 + 2816 + 160 + 13 = 1 072 045!
Awesome, you found the decimal representation of the 10-5B-AD hexadecimal number.
Conclusion
In this tutorial, you learnt how you can easily convert your hexadecimal numbers to decimal.
You learnt that you have to manipulate the powers of 16, and that you have to sum them in order to have a decimal representation.
Have you checked our other tutorials?
How To Find MAC Address on Linux?
How To Find MAC Address on Windows 10?
Do you want us to write on a specific subject?
Send us an email @ ouilookupwebsite@gmail.com
Icons made by FreePik from Flaticon.