Where octal still appears
Octal is base 8, using only the digits 0–7. Each octal digit stands for exactly three bits, which made it popular on early computers with 12-, 24- and 36-bit words. Today it survives mainly in Unix file permissions (chmod 755), where each digit packs the read, write and execute bits for owner, group and others, and in some escape sequences and legacy file formats.
Worked example
755 = 7 × 64 + 5 × 8 + 5 × 1 = 448 + 40 + 5 = 493. In binary that is 111 101 101: read-write-execute for the owner, read-execute for group and others, the usual mode for directories and scripts.
Leading zeros
In C, JavaScript's old syntax and many shells, a number starting with 0 is octal: 0755. The leading zero only marks the base; this page treats it as a harmless leading zero and gives the same 493.
How this works
The page reads the octal digits from left to right, multiplying the running total by 8 and adding each digit (Horner's method), with JavaScript BigInt so the result is exact for any length. Digits 8 and 9 are rejected with a message showing the offending digit. A 0o prefix, spaces and underscores are accepted. The table shows the same value in binary, octal, decimal and hexadecimal and its length in bits. Each line converts separately.
Frequently asked
How do I convert octal to decimal?
Multiply each digit by 8 to the power of its position from the right, starting at 0, and add. 17 = 1 × 8 + 7 = 15.
Why is 8 not a valid octal digit?
Base 8 uses only the digits 0 to 7; 8 is written 10 in octal.
What does chmod 755 mean?
Owner can read, write and execute (7); group and others can read and execute (5). Use the chmod calculator for details.
Does a leading 0 matter?
Not for the value. In code it marks the number as octal.
Sources
Reviewed Oct 17, 2026 · test vectors fixtures/dev/octal-to-decimal/