0xCONVERTER-HEX

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.

OctalBinaryDecimal
00000
10011
20102
30113
41004
51015
61106
71117
Why the two never align

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

ValueHexOctalBits needed
7773
88104
15F174
633F776
64401007
255FF3778
5111FF7779
4095FFF777712

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

HexOctalDecimal
000000
010011
020022
030033
040044
050055
060066
070077
080108
090119
0A01210
0B01311
0C01412
0D01513
0E01614
0F01715
1002016
1102117
1202218
1302319
1402420
1502521
1602622
1702723
1803024
1903125
1A03226
1B03327
1C03428
1D03529
1E03630
1F03731
2004032
2104133
2204234
2304335
2404436
2504537
2604638
2704739
2805040
2905141
2A05242
2B05343
2C05444
2D05545
2E05646
2F05747
3006048
3106149
3206250
3306351
3406452
3506553
3606654
3706755
3807056
3907157
3A07258
3B07359
3C07460
3D07561
3E07662
3F07763
4010064
4110165
4210266
4310367
4410468
4510569
4610670
4710771
4811072
4911173
4A11274
4B11375
4C11476
4D11577
4E11678
4F11779
5012080
5112181
5212282
5312383
5412484
5512585
5612686
5712787
5813088
5913189
5A13290
5B13391
5C13492
5D13593
5E13694
5F13795
6014096
6114197
6214298
6314399
64144100
65145101
66146102
67147103
68150104
69151105
6A152106
6B153107
6C154108
6D155109
6E156110
6F157111
70160112
71161113
72162114
73163115
74164116
75165117
76166118
77167119
78170120
79171121
7A172122
7B173123
7C174124
7D175125
7E176126
7F177127
80200128
81201129
82202130
83203131
84204132
85205133
86206134
87207135
88210136
89211137
8A212138
8B213139
8C214140
8D215141
8E216142
8F217143
90220144
91221145
92222146
93223147
94224148
95225149
96226150
97227151
98230152
99231153
9A232154
9B233155
9C234156
9D235157
9E236158
9F237159
A0240160
A1241161
A2242162
A3243163
A4244164
A5245165
A6246166
A7247167
A8250168
A9251169
AA252170
AB253171
AC254172
AD255173
AE256174
AF257175
B0260176
B1261177
B2262178
B3263179
B4264180
B5265181
B6266182
B7267183
B8270184
B9271185
BA272186
BB273187
BC274188
BD275189
BE276190
BF277191
C0300192
C1301193
C2302194
C3303195
C4304196
C5305197
C6306198
C7307199
C8310200
C9311201
CA312202
CB313203
CC314204
CD315205
CE316206
CF317207
D0320208
D1321209
D2322210
D3323211
D4324212
D5325213
D6326214
D7327215
D8330216
D9331217
DA332218
DB333219
DC334220
DD335221
DE336222
DF337223
E0340224
E1341225
E2342226
E3343227
E4344228
E5345229
E6346230
E7347231
E8350232
E9351233
EA352234
EB353235
EC354236
ED355237
EE356238
EF357239
F0360240
F1361241
F2362242
F3363243
F4364244
F5365245
F6366246
F7367247
F8370248
F9371249
FA372250
FB373251
FC374252
FD375253
FE376254
FF377255

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.

OctalBitsPermissionsHex
0000none0
1001execute1
2010write2
4100read4
5101read, execute5
6110read, write6
7111read, write, execute7
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.