How to convert Octal to Hexadecimal
Converting an octal number from octal system to hexadecimal system we need apply 2 steps:
- Convert octal number from octal system to binary system.
- Convert binary number from binary system to hexadecimal system.
Step 1 : Converting an octal number to binary we need to convert three bit binary value corresponding for each digit of octal number.
Octal | Binary |
0 | 000 |
1 | 001 |
2 | 010 |
3 | 011 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
Step 1 : Converting a binary number to hexadecimal we need to groupping four digit sets from right to left of binary number.
If there are not enough digits for a set then fill the zeros to left side to four digits.
Get each group's hexadecimal equivalent.
Binary | Hexadecimal |
0000 | 0 |
0001 | 1 |
0010 | 2 |
0011 | 3 |
0100 | 4 |
0101 | 5 |
0110 | 6 |
0111 | 7 |
1000 | 8 |
1001 | 9 |
1010 | A |
1011 | B |
1100 | C |
1101 | D |
1110 | E |
1111 | F |
Concatenate the hexadecimal values.
Let's see an example. Octal number is 347 :
Convert each octal digit to binary
- 3 corresponds to 011 in binary
- 4 corresponds to 100 in binary
- 7 corresponds to 111 in binary
Octal 347 in binary is 011100111
Group the binary digits into sets of four, starting from the left : 0111 0011 1
Convert each group to hexadecimal
- 0111 corresponds to 7 in hexadecimal
- 0011 corresponds to 3 in hexadecimal
- 1 corresponds to 1 in hexadecimal
Concatenate the hexadecimal values from left to right: 731
The octal number 347 is equivalent to the hexadecimal number 731