Hex to Octal Converter
To use hexadecimal to octal converter, type any hex value e.g. "7B" and click on the Convert button and you will get the octal value of "173" on right side. You can convert any value upto the range of 7FFFFFFFFFFFFFFF which is 16 hex characters.
Hex to Octal Conversion:
- Hexadecimal Numeral System
- Octal Numeral System
- How to Convert Hex to Octal
- How to Convert Fractional Hex to Octal
- Hex to Octal Examples
- FAQs (Hex to Octal Conversion)
- Hex to Octal Table
Hexadecimal Numeral System (Hex Numbers)
Hexadecimal numbers (often called hex numbers) are a base-16 number system used in mathematics and computer science. Unlike the decimal system (base-10), which uses 10 digits (0–9), hexadecimal uses 16 symbols:
Digits in hexadecimal:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
The symbols A, B, C, D, E, F represent decimal values 10, 11, 12, 13, 14, and 15 respectively. Once F is reached, the next number continues like decimal but in base 16: 10hex = 16decimal and 11hex = 17decimal and so on.
Example:
Every hex digit position represents a power of 16, hex value "A79D.F5" can be broken down as powers to the base 16:
Digit | Position | Power of 16 | Value |
---|---|---|---|
A (10) | 163 (4096's place) | 163 = 4096 | 10 × 4096 = 40960 |
7 | 162 (256's place) | 162 = 256 | 7 × 256 = 1792 |
9 | 161 (16's place) | 161 = 16 | 9 × 16 = 144 |
D (13) | 160 (1's place) | 160 = 1 | 13 × 1 = 13 |
F (15) | 16-1 (1/16's place) | 16-1 = 1/16 = 0.0625 | 15 × 0.0625 = 0.9375 |
5 | 16-2 (1/256's place) | 16-2 = 1/256 = 0.00390625 | 5 × 0.00390625 = 0.01953125 |
Decimal Result: 40960 + 1792 + 144 + 13 + 0.9375 + 0.01953125 = 42,909.95703125
(A79D.F5)16 = (42909.95703125)10
Octal Numeral System
Octal numbers are represented in the base-8 number system. Unlike the decimal system (base-10) which uses 10 digits (0–9) and hexadecimal (base-16) which uses 16 symbols (0–9, A–F), the octal number system uses only 8 digits:
Digits used in octal system:
0, 1, 2, 3, 4, 5, 6, 7
Example:
Each position in an octal number represents a power of 8, therefore octal value "7167.57" can be expressed as powers to the base 8:
Digit | Position | Power of 8 | Value |
---|---|---|---|
7 | 83 place | 83 = 512 | 7 × 512 = 3584 |
1 | 82 place | 82 = 64 | 1 × 64 = 64 |
6 | 81 place | 81 = 8 | 6 × 8 = 48 |
7 | 80 place | 80 = 1 | 7 × 1 = 7 |
5 | 8-1 place | 8-1 = 0.125 | 5 × 0.125 = 0.625 |
7 | 8-2 place | 8-2 = 0.015625 | 7 × 0.015625 = 0.109375 |
(7167.57)8 =
(7 × 83) + (1 × 82) + (6 × 81) + (7 × 80) + (5 × 8-1) + (7 × 8-2)
= 3584 + 64 + 48 + 7 + 0.625 + 0.109375
= (3703.734375)10
How to Convert Hex to Octal
As discussed above the digits of hexadecimal number are represented in nibbles or four bits while the digits of octal number are represented in three bits. Therefore, follow the steps below to convert the hex value to octal. Hex digits from 0 to F are represented in binary from 0000 to 1111.
Step-1: Split hex numbers into hex digits or nibbles (4-bits) and convert the hex digits or nibbles to binary format.
Step-2: Make a group of three bits, and add zero padding on the leftmost side if required. For the case of fractional hex number, add zero padding on the leftmost side for the integral part before the the hexadecimal point (.) and add trailing zeros on the right most side for the fractional part after the hexadecimal point to make 3-bit groups.
Step-3: Convert the 3-bit binary numbers to octal equivalents and combine them to get the final octal value.
How to Convert Fractional Hex to Octal
Follow the following steps to convert the fractional hex value to octal:
Step-1: Get the fractional part from the hex number. For example "9D" is the fractional value from this hex value "2A.9D".
Step-2: Convert this fractional part to binary and make a group of 3-bits and add trailing zeros on the rightmost side if required. For example 9 = 1001 and D = 1101, therefore, 3-bits groups are: 9D = 10011101 = 100 111 010.
Step-3: Convert the 3-bit binary values to octal and combine them to get final fractional octal value. For example, 100 = 4, 111 = 7 and 010 = 2, therefore octal fractional value is (0.472)8.
Hex to Octal Examples
Example 1: Convert the hexadecimal value "1F" to octal value.
Nibble-1 | Nibble-2 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Hex: | 1 | F | |||||||
Decimal: | 1 | 15 | |||||||
Binary: | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | |
0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
Group-1 | Group-2 | Group-3 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
Group-1 | Group-2 | Group-3 | ||||
---|---|---|---|---|---|---|
0 | 3 | 7 |
Example 2: Convert hex value "2DC7" to octal.
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex: | 2 | D | C | 7 | |||||||||||||||
Decimal: | 2 | 13 | 12 | 7 | |||||||||||||||
Binary: | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | |||
0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 2 | 6 | 1 | 7 |
Example 3: Convert hex value "4F9D" to octal.
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex: | 4 | F | 9 | D | |||||||||||||||
Decimal: | 4 | 15 | 9 | 13 | |||||||||||||||
Binary: | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | |||
0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | 7 | 7 | 1 | 6 |
Example 4: Convert the hexadecimal value "2F.D" to octal value.
Nibble-1 | Nibble-2 | Nibble-3 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex: | 2 | F. | D | ||||||||||||||||||
Decimal: | 2 | 15. | 13 | ||||||||||||||||||
Binary: | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | |||||||||
0 | 0 | 1 | 0 | 1 | 1 | 1 | 1. | 1 | 1 | 0 | 1 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1. | 1 | 1 | 0 | 1 | 0 | 0 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 5 | 7. | 6 | 4 |
Example 5: Convert the hex value "3FD4.C3" to octal value.
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | Nibble-5 | Nibble-6 | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex: | 3 | F | D | 4. | C | 3 | |||||||||||||||||||||||||||||||||||||||
Decimal: | 3 | 15 | 13 | 4. | 12 | 3 | |||||||||||||||||||||||||||||||||||||||
Binary: | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | 23 | 22 | 21 | 20 | |||||||||||||||||||||
0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0. | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | Group-6 | Group-7 | Group-8 | Group-9 | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0. | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | Group-6 | Group-7 | Group-8 | Group-9 | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 3 | 7 | 7 | 2 | 4. | 6 | 0 | 6 |
Frequently Ask Questions: Hex to Octal Conversion
Q1: Mask the hex value 0x3FD4 with 0xF0FF and provide the result in octal value?
By masking we mean bitwise AND operation:
0x3FD4 = (0011 1111 1101 0100)2 and 0xF0FF = (1111 0000 1111 1111)2
X = 0011 1111 1101 0100
Y = 1111 0000 1111 1111
-------------------------------------------------
X & Y (Bitwise AND) = 0011 0000 1101 0100
Make a group of 3 bits and do zero padding on left side: 000 011 000 011 010 100
011 = 3, 000 = 0, 011 = 3, 010 = 2, 100 = 4, therefore octal value = (30324)8
Q2: Right shift the hex value 0xF8D3 by 4 and provide the result in octal?
Right shift operation is represented by ">>", while doing the right shift, do the zero padding on the left side:
0xF8D3 = (1111 1000 1101 0011)2
(0xF8D3 >> 4) = (1111 1000 1101 0011)2 >> 4 = (0000 1111 1000 1101)2
Group bits to 3-bits: 000 000 111 110 001 101
111 = 7, 110 = 6, 001 = 1, 101 = 5
Octal value is: (7615)8
Q3: Convert hex value 0xFF.F to octal?
"0x" is the notation used to represent the hexadecimal numbers.
Since F = 1111, 0xFF.F = (11111111.1111)2
Arrange bits into 3-bits group, add zero padding on the left side before hex point and add trailing zeros on the right side after hex point.
3-bits groups = 011 111 111. 111 100
Convert them to octal value: 011 = 3, 111 = 7, 111 = 7, 111 = 7 and 100 = 4
0xFF.F = (377.74)8
Q4: Convert hex value 0x1.1 to octal?
0x1.1 = (0001.0001)2
Arrange bits into 3-bits group: 000 001. 000 100
000 = 0, 001 = 1, 000 = 0, 100 = 4
0x1.1 = (1.04)8
Q5: Convert hex value 0x9.5 to octal?
0x9.5 = (1001.0101)2
Arrange bits into 3-bits group: 001 001. 010 100
001 = 1, 001 = 1, 010 = 2, 100 = 4
0x9.5 = (9.5)16 = (11.24)8
Hex to Octal Conversion Table
Hexadecimal | Octal |
---|---|
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 10 |
9 | 11 |
A | 12 |
B | 13 |
C | 14 |
D | 15 |
E | 16 |
F | 17 |
10 | 20 |
11 | 21 |
12 | 22 |
13 | 23 |
14 | 24 |
15 | 25 |
16 | 26 |
17 | 27 |
18 | 30 |
19 | 31 |
1A | 32 |
1B | 33 |
1C | 34 |
1D | 35 |
1E | 36 |
1F | 37 |
20 | 40 |
21 | 41 |
22 | 42 |
23 | 43 |
24 | 44 |
25 | 45 |
26 | 46 |
27 | 47 |
28 | 50 |
29 | 51 |
2A | 52 |
2B | 53 |
2C | 54 |
2D | 55 |
2E | 56 |
2F | 57 |
30 | 60 |
31 | 61 |
32 | 62 |
33 | 63 |
34 | 64 |
35 | 65 |
36 | 66 |
37 | 67 |
38 | 70 |
39 | 71 |
3A | 72 |
3B | 73 |
3C | 74 |
3D | 75 |
3E | 76 |
3F | 77 |
40 | 100 |
Hexadecimal | Octal |
---|---|
41 | 101 |
42 | 102 |
43 | 103 |
44 | 104 |
45 | 105 |
46 | 106 |
47 | 107 |
48 | 110 |
49 | 111 |
4A | 112 |
4B | 113 |
4C | 114 |
4D | 115 |
4E | 116 |
4F | 117 |
50 | 120 |
51 | 121 |
52 | 122 |
53 | 123 |
54 | 124 |
55 | 125 |
56 | 126 |
57 | 127 |
58 | 130 |
59 | 131 |
5A | 132 |
5B | 133 |
5C | 134 |
5D | 135 |
5E | 136 |
5F | 137 |
60 | 140 |
61 | 141 |
62 | 142 |
63 | 143 |
64 | 144 |
65 | 145 |
66 | 146 |
67 | 147 |
68 | 150 |
69 | 151 |
6A | 152 |
6B | 153 |
6C | 154 |
6D | 155 |
6E | 156 |
6F | 157 |
70 | 160 |
71 | 161 |
72 | 162 |
73 | 163 |
74 | 164 |
75 | 165 |
76 | 166 |
77 | 167 |
78 | 170 |
79 | 171 |
7A | 172 |
7B | 173 |
7C | 174 |
7D | 175 |
7E | 176 |
7F | 177 |
80 | 200 |
Hexadecimal | Octal |
---|---|
81 | 201 |
82 | 202 |
83 | 203 |
84 | 204 |
85 | 205 |
86 | 206 |
87 | 207 |
88 | 210 |
89 | 211 |
8A | 212 |
8B | 213 |
8C | 214 |
8D | 215 |
8E | 216 |
8F | 217 |
90 | 220 |
91 | 221 |
92 | 222 |
93 | 223 |
94 | 224 |
95 | 225 |
96 | 226 |
97 | 227 |
98 | 230 |
99 | 231 |
9A | 232 |
9B | 233 |
9C | 234 |
9D | 235 |
9E | 236 |
9F | 237 |
A0 | 240 |
A1 | 241 |
A2 | 242 |
A3 | 243 |
A4 | 244 |
A5 | 245 |
A6 | 246 |
A7 | 247 |
A8 | 250 |
A9 | 251 |
AA | 252 |
AB | 253 |
AC | 254 |
AD | 255 |
AE | 256 |
AF | 257 |
B0 | 260 |
B1 | 261 |
B2 | 262 |
B3 | 263 |
B4 | 264 |
B5 | 265 |
B6 | 266 |
B7 | 267 |
B8 | 270 |
B9 | 271 |
BA | 272 |
BB | 273 |
BC | 274 |
BD | 275 |
BE | 276 |
BF | 277 |
C0 | 300 |
Hexadecimal | Octal |
---|---|
C1 | 301 |
C2 | 302 |
C3 | 303 |
C4 | 304 |
C5 | 305 |
C6 | 306 |
C7 | 307 |
C8 | 310 |
C9 | 311 |
CA | 312 |
CB | 313 |
CC | 314 |
CD | 315 |
CE | 316 |
CF | 317 |
D0 | 320 |
D1 | 321 |
D2 | 322 |
D3 | 323 |
D4 | 324 |
D5 | 325 |
D6 | 326 |
D7 | 327 |
D8 | 330 |
D9 | 331 |
DA | 332 |
DB | 333 |
DC | 334 |
DD | 335 |
DE | 336 |
DF | 337 |
E0 | 340 |
E1 | 341 |
E2 | 342 |
E3 | 343 |
E4 | 344 |
E5 | 345 |
E6 | 346 |
E7 | 347 |
E8 | 350 |
E9 | 351 |
EA | 352 |
EB | 353 |
EC | 354 |
ED | 355 |
EE | 356 |
EF | 357 |
F0 | 360 |
F1 | 361 |
F2 | 362 |
F3 | 363 |
F4 | 364 |
F5 | 365 |
F6 | 366 |
F7 | 367 |
F8 | 370 |
F9 | 371 |
FA | 372 |
FB | 373 |
FC | 374 |
FD | 375 |
FE | 376 |
FF | 377 |
Related Conversions
Please find the related numeric conversions.