Return
to tool
Number Bases

Decimal to Octal Converter

Convert decimal to octal instantly — type into either field and the other updates as you go. Octal is base 8, so the conversion is repeated division by eight, and the tool below shows every division step for your own number rather than just handing back an answer. It also handles decimal fractions and negative values. Further down there's a chmod chart for the case that brings most people here: a file mode that arrived as a decimal integer and needs reading as permissions.

Decimal ↔ Octal Converter

Type in either field and the other updates as you go. Fractions and negatives welcome. Part of our conversions collection.

Octal notation
Commas, spaces and underscores are fine. Up to 20 digits before the point and 12 after — more than the 19-character cap common elsewhere.
Digits 0-7 only. A 0o or leading-zero prefix is accepted and stripped.
Show the working

Type a number in either field and every division step appears here.

What octal is, and why base 8

Octal is base 8. It uses only the digits 0 through 7 — there is no 8 and no 9, because in base 8 the value eight is written 10, exactly as ten is written 10 in decimal. Each place is worth eight times the one to its right: 1, 8, 64, 512, and so on.

Octal exists because 8 is 2 cubed, which means one octal digit corresponds to exactly three binary digits. That made it valuable in early computing, when machine word sizes were often multiples of three bits. Modern machines settled on 8-bit bytes, which divide evenly into hexadecimal's 4-bit digits but not into octal's 3-bit ones, and hex largely displaced octal as a result. Octal survives mainly in Unix file permissions and a handful of legacy formats.

Converting from decimal is the awkward direction. Ten is not a power of eight, so unlike binary-to-octal — which is pure regrouping — decimal-to-octal requires real arithmetic: repeated division for whole numbers, repeated multiplication for fractions.

How to convert decimal to octal

  1. Divide the decimal number by 8.
  2. Write down the whole-number quotient and the remainder. The remainder will always be 0-7.
  3. Replace the number with the quotient and repeat from step 1.
  4. Stop when the quotient reaches 0.
  5. Read the remainders from the bottom up. That string is your octal number.

Reading bottom-to-top is not arbitrary. Each division peels off the least significant digit first, so the first remainder you produce is the last digit of the answer. Writing the remainders top-to-bottom instead gives you the number backwards, which is the most common error in this conversion — and it is silent, because the reversed string is usually still a valid octal number.

Worked example: 100 in octal

100 divided by 8 is 12 with a remainder of 4. Then 12 divided by 8 is 1 with a remainder of 4. Then 1 divided by 8 is 0 with a remainder of 1, and the quotient has hit zero, so we stop. Reading bottom-to-top gives 1, 4, 4 — so 100 in decimal is 144 in octal. Check it by expanding: (1 x 64) + (4 x 8) + (4 x 1) = 64 + 32 + 4 = 100.

StepDivisionQuotientRemainder
1100 / 8124
212 / 814
31 / 801

Worked example: 255 in octal

255 divided by 8 is 31 remainder 7. Then 31 divided by 8 is 3 remainder 7. Then 3 divided by 8 is 0 remainder 3. Bottom-to-top: 377. So 255 decimal is 377 octal — the largest value a single byte can hold, which is why 377 was the conventional octal byte ceiling on older Unix systems before hex took over.

DecimalDivision stepsRemainders (bottom-up)Octal
88/8=1 r0; 1/8=0 r11,010
5050/8=6 r2; 6/8=0 r66,262
6464/8=8 r0; 8/8=1 r0; 1/8=0 r11,0,0100
9999/8=12 r3; 12/8=1 r4; 1/8=0 r11,4,3143
100100/8=12 r4; 12/8=1 r4; 1/8=0 r11,4,4144
128128/8=16 r0; 16/8=2 r0; 2/8=0 r22,0,0200
200200/8=25 r0; 25/8=3 r1; 3/8=0 r33,1,0310
255255/8=31 r7; 31/8=3 r7; 3/8=0 r33,7,7377
500500/8=62 r4; 62/8=7 r6; 7/8=0 r77,6,4764
511511/8=63 r7; 63/8=7 r7; 7/8=0 r77,7,7777
512512/8=64 r0; 64/8=8 r0; 8/8=1 r0; 1/8=0 r11,0,0,01000
10001000/8=125 r0; 125/8=15 r5; 15/8=1 r7; 1/8=0 r11,7,5,01750

Converting octal back to decimal

The reverse is positional expansion and it is easier than the division method. Number the octal digits from right to left starting at zero, multiply each digit by 8 raised to its position, then add the results. There are no letter digits to translate first, which makes octal simpler to expand by hand than hexadecimal.

Take 144. The rightmost 4 sits at position 0, contributing 4 x 1 = 4. The middle 4 is at position 1, contributing 4 x 8 = 32. The leading 1 is at position 2, contributing 1 x 64 = 64. Adding: 64 + 32 + 4 = 100. Take 755: (7 x 64) + (5 x 8) + (5 x 1) = 448 + 40 + 5 = 493 — a number worth remembering, for reasons the file-modes section below makes clear.

Position (right to left)Place value8^nMax digit contribution
018^07
188^156
2648^2448
35128^33,584
44,0968^428,672
532,7688^5229,376
6262,1448^61,835,008
72,097,1528^714,680,064
816,777,2168^8117,440,512

Decimal fractions and the octal point

Fractions invert the method. Instead of dividing the whole number by 8 and collecting remainders, you multiply the fractional part by 8 and collect the integer parts — and you read those digits top-to-bottom, the opposite direction to the integer half. Getting this backwards is easy and no page currently ranking for this term covers fractional conversion at all.

Take 0.75. Multiply by 8 and you get 6.0. The integer part is 6 and the leftover fraction is 0, so the process stops: 0.75 decimal is 0.6 octal. Check it — 6/8 is indeed 0.75. Take 0.125: multiplied by 8 that is 1.0, so the answer is 0.1 octal, since 1/8 is 0.125.

Most decimal fractions, though, never terminate in octal. 0.1 is the clearest case: multiplying repeatedly gives 0, 6, 3, 1, 4, 6, 3, 1, 4 and onward forever, so 0.1 decimal is 0.0631463146... octal with '6314' repeating. This is the same phenomenon as one-third being 0.333... in decimal — the fraction simply has no exact representation in the target base. The converter above flags repeating expansions rather than truncating them silently.

DecimalMultiplication stepsOctalTerminates?
0.50.5 x 8 = 4.00.4Yes
0.250.25 x 8 = 2.00.2Yes
0.3750.375 x 8 = 3.00.3Yes
0.43750.4375 x 8 = 3.5; 0.5 x 8 = 4.00.34Yes
0.6250.625 x 8 = 5.00.5Yes
0.750.75 x 8 = 6.00.6Yes
0.8750.875 x 8 = 7.00.7Yes
0.1250.125 x 8 = 1.00.1Yes
0.06250.0625 x 8 = 0.5; 0.5 x 8 = 4.00.04Yes
0.031250.03125 x 8 = 0.25; 0.25 x 8 = 2.00.02Yes
0.10.1 x 8 = 0.8; 0.8 x 8 = 6.4; 0.4 x 8 = 3.2; ...0.0631463146...No — 6314 repeats
0.30.3 x 8 = 2.4; 0.4 x 8 = 3.2; 0.2 x 8 = 1.6; ...0.2314631463...No — 3146 repeats

Decimal to octal quick reference

Common decimal values with their octal equivalents, plus binary and hex for cross-reference. The first eight rows are worth memorising because they are the eight octal digits themselves. The same repeated-division method drives the Hex column — see the decimal to hex converter — and for regrouping the Binary column into other bases, see binary to hexadecimal.

Type a decimal value to jump to its row.
DecimalOctalBinaryHex
00000000000000
10010000000101
20020000001002
30030000001103
40040000010004
50050000010105
60060000011006
70070000011107
80100000100008
90110000100109
10012000010100A
11013000010110B
12014000011000C
13015000011010D
14016000011100E
15017000011110F
160200001000010
170210001000111
180220001001012
190230001001113
200240001010014
210250001010115
220260001011016
230270001011117
240300001100018
250310001100119
26032000110101A
27033000110111B
28034000111001C
29035000111011D
30036000111101E
31037000111111F
320400010000020
330410010000121
340420010001022
350430010001123
360440010010024
370450010010125
380460010011026
390470010011127
400500010100028
410510010100129
42052001010102A
43053001010112B
44054001011002C
45055001011012D
46056001011102E
47057001011112F
480600011000030
490610011000131
500620011001032
510630011001133
520640011010034
530650011010135
540660011011036
550670011011137
560700011100038
570710011100139
58072001110103A
59073001110113B
60074001111003C
61075001111013D
62076001111103E
63077001111113F
641000100000040
651010100000141
661020100001042
671030100001143
681040100010044
691050100010145
701060100011046
711070100011147
721100100100048
731110100100149
74112010010104A
75113010010114B
76114010011004C
77115010011014D
78116010011104E
79117010011114F
801200101000050
811210101000151
821220101001052
831230101001153
841240101010054
851250101010155
861260101011056
871270101011157
881300101100058
891310101100159
90132010110105A
91133010110115B
92134010111005C
93135010111015D
94136010111105E
95137010111115F
961400110000060
971410110000161
981420110001062
991430110001163
1001440110010064
1011450110010165
1021460110011066
1031470110011167
1041500110100068
1051510110100169
106152011010106A
107153011010116B
108154011011006C
109155011011016D
110156011011106E
111157011011116F
1121600111000070
1131610111000171
1141620111001072
1151630111001173
1161640111010074
1171650111010175
1181660111011076
1191670111011177
1201700111100078
1211710111100179
122172011110107A
123173011110117B
124174011111007C
125175011111017D
126176011111107E
127177011111117F
1282001000000080
1292011000000181
1302021000001082
1312031000001183
1322041000010084
1332051000010185
1342061000011086
1352071000011187
1362101000100088
1372111000100189
138212100010108A
139213100010118B
140214100011008C
141215100011018D
142216100011108E
143217100011118F
1442201001000090
1452211001000191
1462221001001092
1472231001001193
1482241001010094
1492251001010195
1502261001011096
1512271001011197
1522301001100098
1532311001100199
154232100110109A
155233100110119B
156234100111009C
157235100111019D
158236100111109E
159237100111119F
16024010100000A0
16124110100001A1
16224210100010A2
16324310100011A3
16424410100100A4
16524510100101A5
16624610100110A6
16724710100111A7
16825010101000A8
16925110101001A9
17025210101010AA
17125310101011AB
17225410101100AC
17325510101101AD
17425610101110AE
17525710101111AF
17626010110000B0
17726110110001B1
17826210110010B2
17926310110011B3
18026410110100B4
18126510110101B5
18226610110110B6
18326710110111B7
18427010111000B8
18527110111001B9
18627210111010BA
18727310111011BB
18827410111100BC
18927510111101BD
19027610111110BE
19127710111111BF
19230011000000C0
19330111000001C1
19430211000010C2
19530311000011C3
19630411000100C4
19730511000101C5
19830611000110C6
19930711000111C7
20031011001000C8
20131111001001C9
20231211001010CA
20331311001011CB
20431411001100CC
20531511001101CD
20631611001110CE
20731711001111CF
20832011010000D0
20932111010001D1
21032211010010D2
21132311010011D3
21232411010100D4
21332511010101D5
21432611010110D6
21532711010111D7
21633011011000D8
21733111011001D9
21833211011010DA
21933311011011DB
22033411011100DC
22133511011101DD
22233611011110DE
22333711011111DF
22434011100000E0
22534111100001E1
22634211100010E2
22734311100011E3
22834411100100E4
22934511100101E5
23034611100110E6
23134711100111E7
23235011101000E8
23335111101001E9
23435211101010EA
23535311101011EB
23635411101100EC
23735511101101ED
23835611101110EE
23935711101111EF
24036011110000F0
24136111110001F1
24236211110010F2
24336311110011F3
24436411110100F4
24536511110101F5
24636611110110F6
24736711110111F7
24837011111000F8
24937111111001F9
25037211111010FA
25137311111011FB
25237411111100FC
25337511111101FD
25437611111110FE
25537711111111FF
256400100000000100
5007641111101001F4
5117771111111111FF
51210001000000000200
1000175011111010003E8
1024200010000000000400
20484000100000000000800
40957777111111111111FFF
40961000010000000000001000
819220000100000000000002000
3276810000010000000000000008000
655351777771111111111111111FFFF
655362000001000000000000000010000
1000000364110011110100001001000000F4240

Round values developers look up

DecimalOctalWhy it comes up
77Largest single octal digit
810First two-digit octal value
6377Largest two-digit octal value; max 6-bit
64100First three-digit octal value
255377Max unsigned byte
256400One byte of range
292444chmod r--r--r--
365555chmod r-xr-xr-x
384600chmod rw-------
420644chmod rw-r--r--
436664chmod rw-rw-r--
448700chmod rwx------
493755chmod rwxr-xr-x
509775chmod rwxrwxr-x
511777chmod rwxrwxrwx; max 9-bit
51210002^9
1,0231777Max 10-bit
4,0957777Max 12-bit
32,76777777Max signed 16-bit
65,535177777Max unsigned 16-bit

Where decimal-to-octal actually happens: file modes

Almost nobody converts decimal to octal for its own sake. The situation that produces the query is nearly always the same one: a program returned a file permission as a plain decimal integer, and permissions are conventionally written in octal, so the number looks wrong until you convert it.

Python's os.stat() is the classic source. Ask it for a file's mode and you get something like 33261, which is meaningless until you convert it — 33261 in octal is 100755. The trailing three digits, 755, are the permission bits you recognise from chmod: read, write and execute for the owner, read and execute for everyone else. The leading 100 is the file-type field, which marks it as a regular file rather than a directory or a symlink. Node's fs.statSync, Go's os.FileMode and Ruby's File.stat all behave the same way.

This is why 493 is a number worth recognising. It is 755 in octal, so a permission value stored or logged as 493 is the standard executable-and-directory permission set. Likewise 420 is 644, the ordinary file default. If you have ever seen a config file or a Terraform plan with a mode of 420 and assumed something had gone wrong, this is the explanation.

Decimal modeOctalSymbolicWhat it is
0000---------No permissions at all
146222-w--w--w-Write-only for everyone
292444r--r--r--Read-only for everyone
365555r-xr-xr-xRead and execute, no writes
384600rw-------Private file, e.g. an SSH key
416640rw-r-----Owner edits, group reads
420644rw-r--r--Standard file default
432660rw-rw----Owner and group collaborate
436664rw-rw-r--Group edits, world reads
438666rw-rw-rw-World-writable (rarely wise)
448700rwx------Private directory or script
457711rwx--x--xTraversable but not listable
488750rwxr-x---Owner and group run it
493755rwxr-xr-xStandard directory and script default
509775rwxrwxr-xGroup can write, world can run
511777rwxrwxrwxEverything for everyone (avoid)

For how each octal digit expands into the rwx permission bits themselves, see the binary to octal converter, which covers the three-bits-per-digit mapping in full.

One further trap: a leading zero means octal in several languages. In Python 3 you must write 0o755 and a bare 0755 is a syntax error, which is a deliberate guard. In older Python 2, C and pre-ES6 JavaScript, 0755 silently meant octal 755, while 755 meant decimal 755 — two very different permission sets. If a config value behaves differently after a language upgrade, a lost leading zero is worth checking early.

Who uses this and why

Backend developers and DevOps engineers

Reading file modes returned as decimal integers from stat calls, deployment tooling, container manifests and infrastructure-as-code plans. The decimal-mode table above is built for exactly this lookup, and the permalink means a specific value can be pasted into a ticket or a code review.

Computer science students

Repeated-division base conversion is standard coursework and it is marked on method, not just answer. The working panel prints the division trace for your own number, so you can compare your steps rather than only your result — including the fractional case, which is where most people lose marks.

Embedded and legacy systems engineers

Some older architectures, instruction encodings and datasheet conventions are octal-native, particularly PDP-descended designs. Register fields that split into three-bit chunks are easier to read in octal than in hex, because the field boundaries align with the digits.

Anyone debugging a leading-zero bug

A number written with a leading zero being silently read as octal is a classic source of wrong values in C, older JavaScript and Python 2. Converting both interpretations quickly is usually the fastest way to confirm whether a literal is being read as base 8 or base 10.

Frequently Asked Questions

How do you convert decimal to octal?

Divide the number by 8, note the remainder, then divide the quotient by 8 and note that remainder, repeating until the quotient is zero. Read the remainders from the bottom up to get your octal number. The converter above shows every division step for your own value.

What is 100 in octal?

100 in decimal is 144 in octal. The working is three divisions: 100/8 = 12 remainder 4, then 12/8 = 1 remainder 4, then 1/8 = 0 remainder 1. Expanding 144 back gives (1 x 64) + (4 x 8) + 4 = 100.

What is 255 in octal?

255 in decimal is 377 in octal. It is the largest value a single byte holds, which is why 377 was the conventional octal byte ceiling on early Unix systems. In binary it is 11111111 and in hex it is FF.

Why does Python show a file's permissions as 33261?

Because os.stat() returns the mode as a decimal integer, and 33261 in octal is 100755. The trailing 755 is the permission set you know from chmod, and the leading 100 is the file-type field marking it as a regular file. Convert the number to octal and it becomes readable.

What is 493 in octal, and why does it keep appearing?

493 in decimal is 755 in octal, which is the standard permission set for directories and executable scripts. Tools that store or log permissions as plain integers will show 493 where you expected 755, so recognising it saves a lot of confusion.

How do I convert octal back to decimal?

Multiply each octal digit by 8 raised to its position, counting from the right starting at zero, then add the results. For 144: (1 x 64) + (4 x 8) + (4 x 1) = 100. Or type the octal value into the right-hand field of the converter, since both fields are live.

Why aren't 8 and 9 allowed in octal?

Because base 8 has exactly eight digits, 0 through 7. The value eight is written as 10, in the same way that ten is written 10 in decimal. A digit 8 or 9 in an octal number means it is not a valid octal number.

What if my decimal number has a fractional part?

The method inverts: multiply the fraction by 8 repeatedly and read the integer parts top-to-bottom, rather than dividing and reading bottom-up. So 0.75 x 8 = 6.0, giving 0.6 octal. Many decimal fractions never terminate in octal and repeat instead.

How do I convert a negative decimal to octal?

The converter accepts a leading minus and applies it to the result, so -100 gives -144. Note this is sign-and-magnitude; if you are reading a negative value out of a fixed-width register, convert the two's-complement bit pattern as an unsigned number instead.

What's the difference between octal and hexadecimal?

Octal is base 8 and maps to three binary digits per character; hexadecimal is base 16 and maps to four. Hex became dominant because a byte is eight bits, which divides evenly into two hex digits but not into octal digits. Octal survives mainly in Unix file permissions.

Is octal still used today?

Yes, though narrowly. File permissions and umask values on Unix and Linux are its most common surviving use, alongside some embedded architectures and octal literals in languages where a leading zero or 0o prefix signals base 8.

Mini About Us

We built this decimal to octal converter because the pages ranking for the term are single-direction, ignore fractions entirely, and never mention the one place octal still matters: Unix file permissions. Ours shows every division step, handles fractional and negative values with repeating-expansion detection, and includes a decimal file-mode chart for stat() values like 33261. This site is a part of the ads4good Network.

Read more about Utility Commons here