Loading...
Loading...
Enter decimal numbers and get their octal equivalents in real time. Supports single values and batch input - one number per line.
Base-10 decimal number
Octal (base-8)
Octal is a base-8 number system that uses only the digits 0 through 7. Like any positional number system, each digit position represents a power of the base. The rightmost digit is 8โฐ (equals 1), the next is 8ยน (equals 8), then 8ยฒ (64), then 8ยณ (512), and so on.
Because 8 is a power of 2, octal and binary have a clean relationship. Every octal digit corresponds to exactly 3 binary bits. This made octal a natural choice on early computing systems with word sizes that were multiples of 3 bits. While hex has largely replaced octal in modern practice, octal remains standard in one very important context: Unix file permissions.
This tool converts any decimal integer to its octal equivalent using the repeated-division method. Divide by 8 repeatedly, collecting remainders, and read them in reverse. The tool handles all of that automatically for any value you enter.
The chmod command uses octal numbers to set file permissions on Unix and Linux systems. Permissions are broken into three groups - owner, group, and others - each with three bits for read (4), write (2), and execute (1). These three bits, when summed, give a digit from 0 to 7.
The permission 7 means all three bits set: 4 + 2 + 1 = rwx. The permission 6 means read and write: 4 + 2 = rw-. The permission 5 means read and execute: 4 + 1 = r-x. And 0 means no permissions at all. When you write chmod 755 filename, you are setting owner to rwx (7), group to r-x (5), and others to r-x (5).
If you need to verify what octal value corresponds to a particular decimal permission number read from a system call trace, paste it here to get the octal form for use with chmod.
To convert 365 to octal by hand: divide 365 by 8 to get 45 remainder 5. Divide 45 by 8 to get 5 remainder 5. Divide 5 by 8 to get 0 remainder 5. Reading the remainders from bottom to top gives 555. So 365 in decimal is 555 in octal. You can verify this: (5 x 64) + (5 x 8) + (5 x 1) = 320 + 40 + 5 = 365.
The tool above applies this method for any positive integer you paste in. Batch multiple values by putting each one on a separate line.
What chmod value gives full read, write, and execute for everyone?
The decimal permission sum 7 (4 + 2 + 1) applies to all three groups, giving chmod 777 in octal. This grants owner, group, and others full permissions. It is rarely appropriate for files that should be restricted.
Does the output include a leading zero for C-style octal literals?
No. The output is the minimal octal representation without any prefix. In C, C++, and some other languages, a leading 0 (for example 0755) tells the compiler to interpret the literal as octal. Add the prefix manually if you need it in source code.
Can I convert 0 to octal?
Yes. Zero is 0 in every base. The converter returns 0 for decimal input 0.