How do you change those funny numbers and letters to something you or your computer can understand? Converting hexadecimal to binary is very easy, which is why hexadecimal has been adopted in some programming languages. Converting to decimal is a little more involved, but once you've got it it's easy to repeat for any number.
Steps
-
1Convert each hexadecimal digit to four binary digits. Hexadecimal was adopted in the first place because it's so easy to convert between the two. Essentially, hexadecimal is used as a way to display binary information in a shorter string. This chart is all you need to convert from one to the other: [1] X Research source
Hexadecimal Binary 0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
-
Try it yourself. It really is as simple as changing the digit into the four equivalent binary digits. Here are a few hex numbers for you to convert. Highlight the invisible text to the right of the equal sign to check your work: [2] X Research source
- A23 = 1010 0010 0011
- BEE = 1011 1110 1110
- 70C558 = 0111 0000 1100 0101 0101 1000
Advertisement -
Understand why this works. In the "base two" binary system, n binary digits can be used to represent 2 n different numbers. For example, with four binary digits, you can represent 2 4 = 16 different numbers. Since hexadecimal is a base sixteen system, a one digit number can be used to represent 16 1 = 16 different numbers. This makes conversion between the two systems extremely easy.
- You can also think of this as the counting systems "flipping over" to another digit at the same time. Hexadecimal counts "...D, E, F, 10 " at the same time binary counts "1101, 1110, 1111, 10000 ".
-
Review how base ten works. You use decimal notation every day without having to stop and think about the meaning, but when you first learned it, your parent or teacher might have explained it to you in more detail. A quick review of how ordinary numbers are written will help you convert the number: [3] X Research source
- Each digit in a decimal number is in a certain "place." Moving from right to left, there's the "ones place," "tens place," "hundreds place," and so on. The digit 3 just means 3 if it's in the ones place, but it represents 30 when located in the tens place, and 300 in the hundreds place.
- To put it mathematically, the "places" represent 10 0 , 10 1 , 10 2 , and so on. This is why this system is called "base ten," or "decimal" after the Latin word for "tenth."
-
Write a decimal number as an addition problem. This will probably seem obvious, but it's the same process we'll use to convert a hexadecimal number, so it's a good starting point. Let's rewrite the number 480,137 10 . (Remember, the subscript 10 tells us the number is written in base ten.): [4] X Research source
- Starting with the rightmost digit, 7 = 7 x 10 0 , or 7 x 1
- Moving left, 3 = 3 x 10 1 , or 3 x 10
- Repeating for all digits, we get 480,137 = 4 x100,000 + 8 x10,000 + 0 x1,000 + 1 x100 + 3 x10 + 7 x1.
-
Write the place values next to a hexadecimal number. Since hexadecimal is base sixteen, the "place values" correspond to the powers of sixteen. To convert to decimal, multiply each place value by the corresponding power of sixteen. Start this process by writing the powers of sixteen next to the digits of a hexadecimal number. We'll do this for the hexadecimal number C921 16 . Start on the right with 16 0 , and increase the exponent each time you move left to the next digit: [5] X Research source
- 1 16 = 1 x 16 0 = 1 x 1 (All numbers are in decimal except where noted.)
- 2 16 = 2 x 16 1 = 2 x 16
- 9 16 = 9 x 16 2 = 9 x 256
- C = C x 16 3 = C x 4096
-
Convert alphabetic characters to decimal. Numerical digits are the same in decimal or hexadecimal, so you don't need to change them (for instance, 7 16 = 7 10 ). For alphabetic characters, refer to this list to change them to the decimal equivalent: [6] X Research source
- A = 10
- B = 11
- C = 12 (We'll use this on our example from above.)
- D = 13
- E = 14
- F = 15
-
Perform the calculation. Now that everything is written in decimal, perform each multiplication problem and add the results together. A calculator will be handy for most hexadecimal numbers. Continuing our example from earlier, here's C921 rewritten as a decimal formula and solved: [7] X Research source
- C921 16 = (in decimal) ( 1 x 1) + ( 2 x 16) + ( 9 x 256) + ( 12 x 4096)
- = 1 + 32 + 2,304 + 49,152.
- = 51,489 10 . The decimal version will usually have more digits than the hexadecimal version, since hexadecimal can store more information per digit.
-
Practice the conversion. Here are a few numbers to convert from hexadecimal into decimal. Once you've worked out the answer, highlight the invisible text to the right of the equal sign to check your work:
- 3AB 16 = 939 10
- A1A1 16 = 41377 10
- 5000 16 = 20480 10
- 500D 16 = 20493 10
- 18A2F 16 = 100911 10
-
Know how to use hexadecimal. Our ordinary decimal counting system is base ten, using ten different symbols to display numbers. Hexadecimal is a base sixteen number system, meaning it uses sixteen characters to display numbers.You can check hexadecimal to decimal conversion for big numbers on online tools. [8] X Research source
- Counting from zero upward:
Hexadecimal Decimal Hexadecimal Decimal 00
10
16
11
11
17
22
12
18
33
13
19
44
14
20
55
15
21
66
16
22
77
17
23
88
18
24
99
19
25
A10
1A
26
B11
1B
27
C12
1C
28
D13
1D
29
E14
1E
30
F15
1F
31
- Counting from zero upward:
-
Use subscript to show which system you're using. Whenever it might be unclear which system you're using, use a decimal subscript number to denote the base. For example, 17 10 means "17 in base ten" (an ordinary decimal number). 17 10 = 11 16 , or "11 in base sixteen" (hexadecimal). You can skip this if your number has an alphabetic character in it, such as B or E. No one will mistake that for a decimal number.
Calculator, Practice Problems, and Answers
Community Q&A
-
QuestionWhat is 480137 converted to a hexadecimal and then to a binary number?Community Answer480137 converted to a hexadecimal is 75389, and the binary is 0111 0101 0011 1000 1001.
-
QuestionWhat is the decimal equivalent of the hex number 0x3F?Community Answer63. You just need to convert the 3F part.
-
QuestionHow many permutations are there when using the hexadecimal system?Community AnswerIt depends on how many hexadecimal digits you are using. 1 digit hexadecimal has 16 permutations. 2 digits have 256 permutations, etc. Each hexadecimal digit is represented with 4 bits, so if you have x hexadecimal digits, there are 2 ^ (x * 4) possible permutations.
Video
Tips
- Long hexadecimal numbers may require an online calculator to convert to decimal. You can also skip the work and have an online converter do the work for you, although it's a good idea to understand how the process works. [9] X Research sourceThanks
- You can adapt the "hexadecimal to decimal" conversion to convert any other base x numbering system to decimal. Just replace the powers of sixteen with powers of x instead. Try learning the base-60 Babylonian counting system!Thanks
References
- ↑ https://www.swarthmore.edu/NatSci/echeeve1/Ref/BinaryMath/NumSys.html
- ↑ https://www.bbc.co.uk/bitesize/guides/zfspfcw/revision/5
- ↑ https://math.libretexts.org/Courses/Mount_Royal_University/Higher_Arithmetic/7%3A_Numeration_Systems/7.2%3A_Number_Bases
- ↑ https://www.cuemath.com/numbers/hexadecimal-to-decimal/
- ↑ https://www.cuemath.com/numbers/hexadecimal-to-decimal/
- ↑ https://www.cuemath.com/numbers/hexadecimal-to-decimal/
- ↑ https://www.sci.brooklyn.cuny.edu/~jones/cisc1110/basesystems.pdf
- ↑ https://binarytotext.net/hexadecimal-to-decimal/
- ↑ http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html
About This Article
To convert hexadecimal to binary, convert each hexadecimal digit to 4 binary digits. Each of the 16 hexadecimal digits are equal to 4 binary digits, so all you need to do is memorize the 16 conversions. For example, the hexadecimal 1 is equal to the binary 0001. To convert hexadecimal to decimal, multiply each place value in the hexadecimal number by the corresponding power of sixteen. Then, add all of the products together to get the decimal. If you want to learn how to label the systems you're using in subscripts, keep reading the article!
Reader Success Stories
- "What helped me was the explanation of hexadecimal to binaries, and hex to decimals, and explaining the base ten vs sixteen. I only wish you showed how you got the hexadecimal number at the end." ..." more