Decimal to octal converter
Convert decimal numbers to octal — by repeated division by 8, every step shown. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.
Part of developer tools.
Binary
10101101
Octal
255
Decimal
173
Hexadecimal
AD
Decimal to octal table
| Decimal | Octal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 10 |
| 9 | 11 |
| 10 | 12 |
| 11 | 13 |
| 12 | 14 |
| 13 | 15 |
| 14 | 16 |
| 15 | 17 |
| 16 | 20 |
| 100 | 144 |
| 127 | 177 |
| 255 | 377 |
| 256 | 400 |
| 1000 | 1750 |
| 1024 | 2000 |
| 4096 | 10000 |
| 65535 | 177777 |
| 4294967295 | 37777777777 |
| 18446744073709551615 | 1777777777777777777777 |
The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.
How to convert decimal to octal
Divide the decimal number by 8, write down the remainder, and repeat with the quotient until it reaches 0. The remainders, read from the last one back to the first, are the octal digits. For 173: 173 ÷ 8 = 21 remainder 5; 21 ÷ 8 = 2 remainder 5; 2 ÷ 8 = 0 remainder 2. Read upwards, that is 255. Remainders are always 0 to 7. If dividing by 8 feels error-prone, go to binary first and group the bits by three: 10101101 → 010 101 101 → 255.
Decimal and octal side by side
The largest 16-bit value is 65535 in decimal and 177777 in octal: 5 digits against 6. A decimal digit is worth log₂ 10 ≈ 3.32 bits, against 3 for an octal digit — not a whole ratio, so decimal and octal digits never line up and there is no digit-by-digit shortcut: the whole number has to be divided down, as above. Octal survives mainly in Unix file permissions, where each digit is one read-write-execute triplet: 755 is rwx r-x r-x. In JavaScript and Python source, 173 is written 173 with no prefix in decimal and 0o255 in octal. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — decimal on this page.
Other conversions
Going the other way? Octal to decimal converter.
Or open the full number base converter and see a number in all four bases at once.