Octal to Hexadecimal Conversion
In this tutorial, you will learn about step by step methods used for the conversion of octal to hexadecimal.
Octal & Hexadecimal Number
Octal number has its base as 8. That means it has total of 8 digits, that are 0, 1, 2, ..., 6, 7. Whereas hexadecimal number has its base as 16. That means it has total of 16 digits, that are 0, 1, 2, ..., 8, 9, A, B, C, D, E, F. In Hexadecimal number system, digit 10 to 15 are be represented by character A to F. That is A represents 10, B represents 11, ..., E represents 14, and F represents 15
Octal to Hexadecimal Formula
To convert any octal number to hexadecimal system, we have to first convert that octal number into binary, and then convert that binary number into hexadecimal number.
For example, (435)8 = ( ? )16
We have to convert the above number, 435 given in octal system into hexadecimal number system. Then we have to convert its binary equivalent. The figure given below shows its binary equivalent or binary equivalent of 435.
According to the figure given above, we have 100 011 101 is the value, that is binary equivalent of octal number 435. Now let’s convert it into hexadecimal system. Or we have to calculate, (100011010)2 = ( ? )16
Before proceeding, we have to make 4-4 pair of binary bit, and here we have total of 9 digit, therefore to make 4-4- pair, we have to add 3 zero before the number, after adding three zero we have 000100011101. Now make 4-4 pair and convert each pair into it’s hexadecimal equivalent as shown in the figure given below.
According to the above figure, we have hexadecimal equivalent is 11D. Therefore, (435)8 = (11D)16
Octal to Hexadecimal Steps
Let's suppose the given octal number is 1452. Now take a deep look at the box given below that will show you the rules to do the job:
1 4 5 2 (write all octal digits) 001 100 101 010 (write its binary equivalent) 001100101010 (combine all binary digits) 0011 0010 1010 (make 4-4 binary pair) 3 2 10 (write decimal equivalent of each binary pair) 3 2 A (convert digit 10 to 15 into character A to F) =32A
As you can see from the above box
- First you have to write all the octal digits
- And then write binary equivalent of each octal digit one by one in 3-3 binary pair
- Then combine all the binary pairs. Now make 4-4 binary pair
- Write decimal equivalent of each binary pair
If any digit greater than 9 is available as decimal digit, then convert it into character as told above. Therefore from the above box, hexadecimal equivalent of given octal number 1452 is 32A. Or you can write (1452)8 = (32A)16
Programs Made on This
- Octal to Hexadecimal in C
- Octal to Hexadecimal in C++
- Octal to Hexadecimal in Java
- Octal to Hexadecimal in Python
« Previous Tutorial Next Tutorial »