Octal to Hex Converter
To use octal to hex converter, type any octal value e.g. "73" and click on the Convert button and you will get the hexadecimal value of "3B" on right side.
Octal to Hexadecimal Conversion:
- Octal Numeral System
- Hexadecimal Numeral System
- How to Convert Octal to Hex
- How to Convert Fractional Octal to Hex
- Octal to Hex Examples
- FAQs (Octal to Hex Conversion)
- Octal to Hex Table
Octal Numeral System
The octal number system, also known as base-8, is a numeral system that uses eight distinct digits: 0, 1, 2, 3, 4, 5, 6, and 7. Each position in an octal number represents a power of 8.
Example:
Octal number "1775.64" represented as power of 8:
Digit | Position | Power of 8 | Value |
---|---|---|---|
1 | 83 place | 83 = 512 | 1 × 512 = 512 |
7 | 82 place | 82 = 64 | 7 × 64 = 448 |
7 | 81 place | 81 = 8 | 7 × 8 = 56 |
5 | 80 place | 80 = 1 | 5 × 1 = 5 |
6 | 8-1 place | 8-1 = 0.125 | 6 × 0.125 = 0.75 |
4 | 8-2 place | 8-2 = 0.015625 | 4 × 0.015625 = 0.0625 |
(1775.64)8 = (1 × 83) + (7 × 82) + (7 × 81) + (5 × 80) + (6 × 8-1) + (4 × 8-2) = 512 + 448 + 56 + 5 + 0.75 + 0.0625 = (1021.8125)10
Hexadecimal Numeral System (Hex Numbers)
The hexadecimal number system, often shortened to "hex," is a base-16 numeral system. Unlike the decimal (base-10) system which uses digits 0-9, hexadecimal uses 16 unique symbols: the digits 0-9 and the letters A-F or a-f. The letters A through F represent the decimal values 10 through 15, respectively. Every hex digit in a hex number represents a power of 16.
Example:
Hex value "FD79.A6E" can be written as power of 16:
Digit | Position | Power of 16 | Value |
---|---|---|---|
F (15) | 163 (4096's place) | 163 = 4096 | 15 × 4096 = 61440 |
D (13) | 162 (256's place) | 162 = 256 | 13 × 256 = 3328 |
7 | 161 (16's place) | 161 = 16 | 7 × 16 = 112 |
9 | 160 (1's place) | 160 = 1 | 9 × 1 = 9 |
A (10) | 16-1 place | 16-1 = 1/16 = 0.0625 | 10 × 0.0625 = 0.625 |
6 | 16-2 place | 16-2 = 1/256 = 0.00390625 | 6 × 0.00390625 = 0.0234375 |
E (14) | 16-3 place | 16-3 = 1/4096 = 0.00024414 | 14 × 0.00024414 = 0.00341797 |
(FD79.A6E)16 = (15 × 163) + (13 × 162) + (7 × 161) + (9 × 160) + (10 × 16-1) + (6 × 16-2) + (14 × 16-3) = 61440 + 3328 + 112 + 9 + 0.625 + 0.0234375 + 0.00341797 = (64889.65185547)10
How to Convert the Octal to Hex
To convert the octal value to hexadecimal value consider the following steps:
Step-1: Convert the octal number to binary format.
Step-2: Make a group of 4-bits or nibbles as every hex digit is represented by 4-bits. For the integral part to complete 4-bit groups you can pad zeros on the left most side and similarly for the fractional octal numbers, we need to add trailing zeros after the octal point to complete 4-bits groups.
Step-3: Now we can convert the 4-bit nibbles to the corresponding hex values and combine them to get the final hexadecimal value.
How to Convert Fractional Octal to Hex
We can also convert the fractional octal value to the corresponding hex value using the following steps:
Step-1: Separate the fractional part from the octal number and convert it into the binary format.
Step-2: Group the bit into 4-bits and add trailing zeros if required.
Step-3: Convert each 4-bit group into a hex digit and combine them all to get the final fractional hex value.
Octal to Hex Examples
Example 1: Convert the octal value "731" to hex.
Group-1 | Group-2 | Group-3 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octal Digits: | 7 | 3 | 1 | |||||||||||
Position: | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | |||||
4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | ||||||
Bits: | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 |
Nibble-1 | Nibble-2 | Nibble-3 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4-Bits Group: | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 |
Nibble-1 | Nibble-2 | Nibble-3 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex Digits: | 1 | D | 9 |
Example 2: Convert the octal value "7627" to hex.
Group-1 | Group-2 | Group-3 | Group-4 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octal Digits: | 7 | 6 | 2 | 7 | |||||||||||||||
Position: | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | |||||||
4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | ||||||||
Bits: | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 |
Nibble-1 | Nibble-2 | Nibble-3 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4-Bits Group: | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
Nibble-1 | Nibble-2 | Nibble-3 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex Digits: | 7 | 6 | F |
Example 3: Convert the octal value "77356" to hex.
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octal Digits: | 7 | 7 | 3 | 5 | 6 | |||||||||||||||||||
Position: | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | |||||||||
4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | ||||||||||
Bits: | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4-Bits Group: | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex Digits: | 7 | E | E | E |
Example 4: Convert (23.17)8 to hexadecimal.
Group-1 | Group-2 | Group-3 | Group-4 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octal Digit: | 2 | 3. | 1 | 7 | |||||||||||||||
Position: | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | |||||||
4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | ||||||||
Bits: | 0 | 1 | 0 | 0 | 1 | 1. | 0 | 0 | 1 | 1 | 1 | 1 |
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4-Bits Group: | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1. | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex Digits: | 1 | 3. | 3 | C |
Example 5: Convert (7726.756)8 to hexadecimal.
Group-1 | Group-2 | Group-3 | Group-4 | Group-5 | Group-6 | Group-7 | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octal Digit: | 7 | 7 | 2 | 6. | 7 | 5 | 6 | ||||||||||||||||||||||||||||||
Position: | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | 22 | 21 | 20 | ||||||||||||||||
4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | 4 | 2 | 1 | |||||||||||||||||
Bits: | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0. | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | Nibble-5 | Nibble-6 | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4-Bits Group: | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0. | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | Nibble-5 | Nibble-6 | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hex Digits: | F | D | 6. | F | 7 | 0 |
Frequently Ask Questions: Octal to Hex Conversion
Q1: A network subnet mask is given as 377777700 in octal. Convert it to hexadecimal notation?
Let's convert every octal digit to binary, 3 = 011, 7 = 111, 0 = 000, therefore:
(377777700)8 = (011 111 111 111 111 111 111 000 000)2, Now we group all these bits into 4-bits group from left side.
4-bit groups: 0011 1111 1111 1111 1111 1100 0000, now converting it back to hex digits, 0011 = 3, 1111 = F, 1100 = C, 0000 = 0
(377777700)8 = (3FFFFC0)16
Q2: Convert the octal memory address 677777 to hexadecimal for addressing in a 24-bit system.
Convert every octal digit to binary: 6 = 110, 7 = 111
(677777)8 = (110 111 111 111 111 111)2, make 4-bits group for 24-bit addressing:
Make 4-bit groups with zero padding on the left side: 0011 0111 1111 1111 1111, converting it to hex digits, 0011 = 3, 0111 = 7, 1111 = F
(677777)8 = (37FFF)16
Q3: Apply a mask (0x3F) to the octal value (7653)8 and convert the result to hexadecimal?
In binary 7 = 111, 6 = 110, 5 = 101, 3 = 011
(7653)8 = (111 110 101 011)2, and masking with 0x3F = (0011 1111)2
By masking we mean bit-wise AND operation and mask in 12-bit is 0x03F:
A = 111110101011
B = 000000111111
-----------------------------------------
A & B (Bitwise AND) = 000010101011
4-bit groups for hex digits: 0000,1010 and 1011, Convert them to hex digits, 0000 = 0 (hex digit), 1010 = A (hex digit) and 1011 = B (hex digit)
Final hex value is: (0AB)16 = (AB)16
Q4: How to convert octal (1.1)8 to hex value?
(1.1)8 = (001.001)2 in binary
Make 4-bit groups: 0001.0010, hex value is: 1.216
Q5: How to convert octal (7.7)8 to hex value?
As 7 = 111, (7.7)8 = (111.111)2 in binary
Make 4-bit groups by padding zeros on the MSB side of integral part and trailing zeros on the fractional part: 0111.1110, hex value is: 7.E16
Q6: Convert octal (77.77)8 to hex value?
As 7 = 111, (77.77)8 = (111111.111111)2 in binary
4-bit groups: 0011 1111.1111 1100, converting nibbles to hex digits, 0011 = 3, 1111 = F, 1100 = C, hex value is: 3F.FC16
Q7: Why we used hex number system more commonly compared to octal?
Hexadecimal is widely used in computing because it provides a more human-readable way to represent data. Since 16 is a power of 2 i.e.(24), a single hexadecimal digit can represent four binary digits (bits) compared to octal which can represent only three. This makes it much easier to read and work with large numbers. Hex numbers are widely used in various fields of computer science and technology, for example, in web design (HTML and CSS), color codes are often defined using a six-digit hex code, e.g. #FF0012. Similarly, they are also used to represent memory addresses in embedded electronics and MAC (Media Access Control) addresses in networking using 12 hex digits e.g. 00:1B:44:11:3A:B7.
Octal to Hex Conversion Table
Octal | Hexadecimal |
---|---|
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
10 | 8 |
11 | 9 |
12 | A |
13 | B |
14 | C |
15 | D |
16 | E |
17 | F |
20 | 10 |
21 | 11 |
22 | 12 |
23 | 13 |
24 | 14 |
25 | 15 |
26 | 16 |
27 | 17 |
30 | 18 |
31 | 19 |
32 | 1A |
33 | 1B |
34 | 1C |
35 | 1D |
36 | 1E |
37 | 1F |
40 | 20 |
41 | 21 |
42 | 22 |
43 | 23 |
44 | 24 |
45 | 25 |
46 | 26 |
47 | 27 |
50 | 28 |
51 | 29 |
52 | 2A |
53 | 2B |
54 | 2C |
55 | 2D |
56 | 2E |
57 | 2F |
60 | 30 |
61 | 31 |
62 | 32 |
63 | 33 |
64 | 34 |
65 | 35 |
66 | 36 |
67 | 37 |
70 | 38 |
71 | 39 |
72 | 3A |
73 | 3B |
74 | 3C |
75 | 3D |
76 | 3E |
77 | 3F |
100 | 40 |
Octal | Hexadecimal |
---|---|
101 | 41 |
102 | 42 |
103 | 43 |
104 | 44 |
105 | 45 |
106 | 46 |
107 | 47 |
110 | 48 |
111 | 49 |
112 | 4A |
113 | 4B |
114 | 4C |
115 | 4D |
116 | 4E |
117 | 4F |
120 | 50 |
121 | 51 |
122 | 52 |
123 | 53 |
124 | 54 |
125 | 55 |
126 | 56 |
127 | 57 |
130 | 58 |
131 | 59 |
132 | 5A |
133 | 5B |
134 | 5C |
135 | 5D |
136 | 5E |
137 | 5F |
140 | 60 |
141 | 61 |
142 | 62 |
143 | 63 |
144 | 64 |
145 | 65 |
146 | 66 |
147 | 67 |
150 | 68 |
151 | 69 |
152 | 6A |
153 | 6B |
154 | 6C |
155 | 6D |
156 | 6E |
157 | 6F |
160 | 70 |
161 | 71 |
162 | 72 |
163 | 73 |
164 | 74 |
165 | 75 |
166 | 76 |
167 | 77 |
170 | 78 |
171 | 79 |
172 | 7A |
173 | 7B |
174 | 7C |
175 | 7D |
176 | 7E |
177 | 7F |
200 | 80 |
Octal | Hexadecimal |
---|---|
201 | 81 |
202 | 82 |
203 | 83 |
204 | 84 |
205 | 85 |
206 | 86 |
207 | 87 |
210 | 88 |
211 | 89 |
212 | 8A |
213 | 8B |
214 | 8C |
215 | 8D |
216 | 8E |
217 | 8F |
220 | 90 |
221 | 91 |
222 | 92 |
223 | 93 |
224 | 94 |
225 | 95 |
226 | 96 |
227 | 97 |
230 | 98 |
231 | 99 |
232 | 9A |
233 | 9B |
234 | 9C |
235 | 9D |
236 | 9E |
237 | 9F |
240 | A0 |
241 | A1 |
242 | A2 |
243 | A3 |
244 | A4 |
245 | A5 |
246 | A6 |
247 | A7 |
250 | A8 |
251 | A9 |
252 | AA |
253 | AB |
254 | AC |
255 | AD |
256 | AE |
257 | AF |
260 | B0 |
261 | B1 |
262 | B2 |
263 | B3 |
264 | B4 |
265 | B5 |
266 | B6 |
267 | B7 |
270 | B8 |
271 | B9 |
272 | BA |
273 | BB |
274 | BC |
275 | BD |
276 | BE |
277 | BF |
300 | C0 |
Octal | Hexadecimal |
---|---|
301 | C1 |
302 | C2 |
303 | C3 |
304 | C4 |
305 | C5 |
306 | C6 |
307 | C7 |
310 | C8 |
311 | C9 |
312 | CA |
313 | CB |
314 | CC |
315 | CD |
316 | CE |
317 | CF |
320 | D0 |
321 | D1 |
322 | D2 |
323 | D3 |
324 | D4 |
325 | D5 |
326 | D6 |
327 | D7 |
330 | D8 |
331 | D9 |
332 | DA |
333 | DB |
334 | DC |
335 | DD |
336 | DE |
337 | DF |
340 | E0 |
341 | E1 |
342 | E2 |
343 | E3 |
344 | E4 |
345 | E5 |
346 | E6 |
347 | E7 |
350 | E8 |
351 | E9 |
352 | EA |
353 | EB |
354 | EC |
355 | ED |
356 | EE |
357 | EF |
360 | F0 |
361 | F1 |
362 | F2 |
363 | F3 |
364 | F4 |
365 | F5 |
366 | F6 |
367 | F7 |
370 | F8 |
371 | F9 |
372 | FA |
373 | FB |
374 | FC |
375 | FD |
376 | FE |
377 | FF |
Related Conversions
Please find the related numeric conversions.