What Is the Decimal to Octal Converter?
This tool converts a decimal number (base 10, the everyday number system) into its octal equivalent (base 8). Octal uses only the digits 0 through 7 and was historically popular in computing because three binary bits map neatly to one octal digit. It still appears today, most notably in Unix/Linux file permissions such as chmod 755.
How to Use It
Type a non-negative whole number into the field and submit. The converter returns the octal string and echoes back the original decimal value for reference. Negative numbers are treated as zero.
The Formula Explained
Conversion uses the repeated division by 8 method. Divide the number by 8 and record the remainder (0–7). Replace the number with the integer quotient and repeat until the quotient is 0. The octal result is the sequence of remainders read in reverse — from the last remainder to the first.
$$\text{Octal} = \left(\text{Decimal}\right)_{10} = \left(\sum_{i=0}^{k} d_i \cdot 8^{\,i}\right)_{8}$$
$$d_i = \left(\left\lfloor \frac{\text{Decimal}}{8^{\,i}} \right\rfloor \bmod 8\right)$$
Worked Example
Convert 125 to octal:
\(125 \div 8 = 15\) remainder 5
\(15 \div 8 = 1\) remainder 7
\(1 \div 8 = 0\) remainder 1
Reading the remainders bottom-up gives 175. Check: $$1\times 64 + 7\times 8 + 5\times 1 = 64 + 56 + 5 = 125.$$ ✓
FAQ
What digits does octal use? Only 0, 1, 2, 3, 4, 5, 6, and 7 — there is no digit 8 or 9.
What is decimal 0 in octal? It is simply 0.
Why is octal used in file permissions? Each permission group (read=4, write=2, execute=1) sums to a value 0–7, which is exactly one octal digit, making permissions compact and readable.