Reference
Hex to Octal Conversion Table
Every value from 00 to FF in hexadecimal and octal, with the bit patterns that connect them.
Octal digits and their bits
Eight digits, three bits each — against hex's sixteen digits and four bits.
| Octal | Binary | Decimal |
|---|---|---|
| 0 | 000 | 0 |
| 1 | 001 | 1 |
| 2 | 010 | 2 |
| 3 | 011 | 3 |
| 4 | 100 | 4 |
| 5 | 101 | 5 |
| 6 | 110 | 6 |
| 7 | 111 | 7 |
A hex digit is four bits and an octal digit is three. Neither divides into the other, so there is no fixed number of hex digits that maps onto a whole number of octal digits. Converting between them means going through the bits.
Where the mismatch shows
| Value | Hex | Octal | Bits needed |
|---|---|---|---|
| 7 | 7 | 7 | 3 |
| 8 | 8 | 10 | 4 |
| 15 | F | 17 | 4 |
| 63 | 3F | 77 | 6 |
| 64 | 40 | 100 | 7 |
| 255 | FF | 377 | 8 |
| 511 | 1FF | 777 | 9 |
| 4095 | FFF | 7777 | 12 |
The rows where both are neat — 63, 511, 4095 — are the ones where the bit count happens to divide by both three and four. That only occurs every twelve bits.
Full table: 00 to FF
| Hex | Octal | Decimal |
|---|---|---|
| 00 | 000 | 0 |
| 01 | 001 | 1 |
| 02 | 002 | 2 |
| 03 | 003 | 3 |
| 04 | 004 | 4 |
| 05 | 005 | 5 |
| 06 | 006 | 6 |
| 07 | 007 | 7 |
| 08 | 010 | 8 |
| 09 | 011 | 9 |
| 0A | 012 | 10 |
| 0B | 013 | 11 |
| 0C | 014 | 12 |
| 0D | 015 | 13 |
| 0E | 016 | 14 |
| 0F | 017 | 15 |
| 10 | 020 | 16 |
| 11 | 021 | 17 |
| 12 | 022 | 18 |
| 13 | 023 | 19 |
| 14 | 024 | 20 |
| 15 | 025 | 21 |
| 16 | 026 | 22 |
| 17 | 027 | 23 |
| 18 | 030 | 24 |
| 19 | 031 | 25 |
| 1A | 032 | 26 |
| 1B | 033 | 27 |
| 1C | 034 | 28 |
| 1D | 035 | 29 |
| 1E | 036 | 30 |
| 1F | 037 | 31 |
| 20 | 040 | 32 |
| 21 | 041 | 33 |
| 22 | 042 | 34 |
| 23 | 043 | 35 |
| 24 | 044 | 36 |
| 25 | 045 | 37 |
| 26 | 046 | 38 |
| 27 | 047 | 39 |
| 28 | 050 | 40 |
| 29 | 051 | 41 |
| 2A | 052 | 42 |
| 2B | 053 | 43 |
| 2C | 054 | 44 |
| 2D | 055 | 45 |
| 2E | 056 | 46 |
| 2F | 057 | 47 |
| 30 | 060 | 48 |
| 31 | 061 | 49 |
| 32 | 062 | 50 |
| 33 | 063 | 51 |
| 34 | 064 | 52 |
| 35 | 065 | 53 |
| 36 | 066 | 54 |
| 37 | 067 | 55 |
| 38 | 070 | 56 |
| 39 | 071 | 57 |
| 3A | 072 | 58 |
| 3B | 073 | 59 |
| 3C | 074 | 60 |
| 3D | 075 | 61 |
| 3E | 076 | 62 |
| 3F | 077 | 63 |
| 40 | 100 | 64 |
| 41 | 101 | 65 |
| 42 | 102 | 66 |
| 43 | 103 | 67 |
| 44 | 104 | 68 |
| 45 | 105 | 69 |
| 46 | 106 | 70 |
| 47 | 107 | 71 |
| 48 | 110 | 72 |
| 49 | 111 | 73 |
| 4A | 112 | 74 |
| 4B | 113 | 75 |
| 4C | 114 | 76 |
| 4D | 115 | 77 |
| 4E | 116 | 78 |
| 4F | 117 | 79 |
| 50 | 120 | 80 |
| 51 | 121 | 81 |
| 52 | 122 | 82 |
| 53 | 123 | 83 |
| 54 | 124 | 84 |
| 55 | 125 | 85 |
| 56 | 126 | 86 |
| 57 | 127 | 87 |
| 58 | 130 | 88 |
| 59 | 131 | 89 |
| 5A | 132 | 90 |
| 5B | 133 | 91 |
| 5C | 134 | 92 |
| 5D | 135 | 93 |
| 5E | 136 | 94 |
| 5F | 137 | 95 |
| 60 | 140 | 96 |
| 61 | 141 | 97 |
| 62 | 142 | 98 |
| 63 | 143 | 99 |
| 64 | 144 | 100 |
| 65 | 145 | 101 |
| 66 | 146 | 102 |
| 67 | 147 | 103 |
| 68 | 150 | 104 |
| 69 | 151 | 105 |
| 6A | 152 | 106 |
| 6B | 153 | 107 |
| 6C | 154 | 108 |
| 6D | 155 | 109 |
| 6E | 156 | 110 |
| 6F | 157 | 111 |
| 70 | 160 | 112 |
| 71 | 161 | 113 |
| 72 | 162 | 114 |
| 73 | 163 | 115 |
| 74 | 164 | 116 |
| 75 | 165 | 117 |
| 76 | 166 | 118 |
| 77 | 167 | 119 |
| 78 | 170 | 120 |
| 79 | 171 | 121 |
| 7A | 172 | 122 |
| 7B | 173 | 123 |
| 7C | 174 | 124 |
| 7D | 175 | 125 |
| 7E | 176 | 126 |
| 7F | 177 | 127 |
| 80 | 200 | 128 |
| 81 | 201 | 129 |
| 82 | 202 | 130 |
| 83 | 203 | 131 |
| 84 | 204 | 132 |
| 85 | 205 | 133 |
| 86 | 206 | 134 |
| 87 | 207 | 135 |
| 88 | 210 | 136 |
| 89 | 211 | 137 |
| 8A | 212 | 138 |
| 8B | 213 | 139 |
| 8C | 214 | 140 |
| 8D | 215 | 141 |
| 8E | 216 | 142 |
| 8F | 217 | 143 |
| 90 | 220 | 144 |
| 91 | 221 | 145 |
| 92 | 222 | 146 |
| 93 | 223 | 147 |
| 94 | 224 | 148 |
| 95 | 225 | 149 |
| 96 | 226 | 150 |
| 97 | 227 | 151 |
| 98 | 230 | 152 |
| 99 | 231 | 153 |
| 9A | 232 | 154 |
| 9B | 233 | 155 |
| 9C | 234 | 156 |
| 9D | 235 | 157 |
| 9E | 236 | 158 |
| 9F | 237 | 159 |
| A0 | 240 | 160 |
| A1 | 241 | 161 |
| A2 | 242 | 162 |
| A3 | 243 | 163 |
| A4 | 244 | 164 |
| A5 | 245 | 165 |
| A6 | 246 | 166 |
| A7 | 247 | 167 |
| A8 | 250 | 168 |
| A9 | 251 | 169 |
| AA | 252 | 170 |
| AB | 253 | 171 |
| AC | 254 | 172 |
| AD | 255 | 173 |
| AE | 256 | 174 |
| AF | 257 | 175 |
| B0 | 260 | 176 |
| B1 | 261 | 177 |
| B2 | 262 | 178 |
| B3 | 263 | 179 |
| B4 | 264 | 180 |
| B5 | 265 | 181 |
| B6 | 266 | 182 |
| B7 | 267 | 183 |
| B8 | 270 | 184 |
| B9 | 271 | 185 |
| BA | 272 | 186 |
| BB | 273 | 187 |
| BC | 274 | 188 |
| BD | 275 | 189 |
| BE | 276 | 190 |
| BF | 277 | 191 |
| C0 | 300 | 192 |
| C1 | 301 | 193 |
| C2 | 302 | 194 |
| C3 | 303 | 195 |
| C4 | 304 | 196 |
| C5 | 305 | 197 |
| C6 | 306 | 198 |
| C7 | 307 | 199 |
| C8 | 310 | 200 |
| C9 | 311 | 201 |
| CA | 312 | 202 |
| CB | 313 | 203 |
| CC | 314 | 204 |
| CD | 315 | 205 |
| CE | 316 | 206 |
| CF | 317 | 207 |
| D0 | 320 | 208 |
| D1 | 321 | 209 |
| D2 | 322 | 210 |
| D3 | 323 | 211 |
| D4 | 324 | 212 |
| D5 | 325 | 213 |
| D6 | 326 | 214 |
| D7 | 327 | 215 |
| D8 | 330 | 216 |
| D9 | 331 | 217 |
| DA | 332 | 218 |
| DB | 333 | 219 |
| DC | 334 | 220 |
| DD | 335 | 221 |
| DE | 336 | 222 |
| DF | 337 | 223 |
| E0 | 340 | 224 |
| E1 | 341 | 225 |
| E2 | 342 | 226 |
| E3 | 343 | 227 |
| E4 | 344 | 228 |
| E5 | 345 | 229 |
| E6 | 346 | 230 |
| E7 | 347 | 231 |
| E8 | 350 | 232 |
| E9 | 351 | 233 |
| EA | 352 | 234 |
| EB | 353 | 235 |
| EC | 354 | 236 |
| ED | 355 | 237 |
| EE | 356 | 238 |
| EF | 357 | 239 |
| F0 | 360 | 240 |
| F1 | 361 | 241 |
| F2 | 362 | 242 |
| F3 | 363 | 243 |
| F4 | 364 | 244 |
| F5 | 365 | 245 |
| F6 | 366 | 246 |
| F7 | 367 | 247 |
| F8 | 370 | 248 |
| F9 | 371 | 249 |
| FA | 372 | 250 |
| FB | 373 | 251 |
| FC | 374 | 252 |
| FD | 375 | 253 |
| FE | 376 | 254 |
| FF | 377 | 255 |
Unix permission modes
This is where most people actually meet octal, and it is a good illustration of when three-bit grouping is the right choice.
| Octal | Bits | Permissions | Hex |
|---|---|---|---|
| 0 | 000 | none | 0 |
| 1 | 001 | execute | 1 |
| 2 | 010 | write | 2 |
| 4 | 100 | read | 4 |
| 5 | 101 | read, execute | 5 |
| 6 | 110 | read, write | 6 |
| 7 | 111 | read, write, execute | 7 |
chmod 755 7 = 111 owner: read, write, execute 5 = 101 group: read, execute 5 = 101 others: read, execute the same value in hex: 1ED
755 shows three permission triples at a glance. 1ED is the same number
and shows nothing. Where the underlying fields are three bits wide, octal genuinely is the better
notation — which is why it survives there and almost nowhere else.
Converting between them
Go through binary in both directions. Expand to bits, then regroup: fours for hex, threes for octal, always counting from the right. The hex to octal converter and octal to hex converter do this for values of any length.
Frequently asked questions
What is FF in octal?
377. Both represent 255 in decimal.
Why does octal have no 8 or 9?
Base 8 uses only digits 0 to 7. Eight rolls over to 10 in octal, the same way ten rolls over to 10 in decimal.
How do I convert hex to octal?
Expand each hex digit to four bits, join them, then regroup the bit string into threes from the right.
Why is there no direct digit mapping?
A hex digit is four bits and an octal digit is three. Neither divides into the other, so the digits never line up.
What is chmod 755 in hex?
1ED. But hex is the wrong notation for permissions, because the fields are three bits wide.
Is octal still used?
Mainly in Unix file permissions. It was common on older machines with word sizes divisible by three, before eight-bit bytes made hex the better fit.