About the Decimal to Octal
To convert decimal to octal, divide by 8 repeatedly and write down the remainders (always 0–7). The remainders read from the last to the first are the octal digits. For 493: 493 ÷ 8 = 61 remainder 5, 61 ÷ 8 = 7 remainder 5, 7 ÷ 8 = 0 remainder 7, so 493 = 755 in octal. The table below the result repeats these steps for your input.
There is also a shortcut through binary: write the number in binary and group the bits in threes from the right, because 8 = 23. 493 is 111 101 101 in binary, and the groups read 7, 5, 5. That three-bit grouping is exactly why Unix permissions are written in octal — each digit holds the read, write and execute bits for one class of user.
When you use the result in code, add the right prefix: 0o755 in Python 3, JavaScript and Rust, 0755 in C, Go and shell chmod. Other places octal still appears include escape sequences such as \033 (the ESC character, decimal 27) in shell and C strings, and some older file formats such as tar headers. The converter uses BigInt, so very large values stay exact.
How to use it
- Type a whole decimal number.
- Read the octal result.
- Follow the divide-by-8 table to see how each digit is produced.
- Copy the result and add the prefix your language expects (0o or 0).