Decimal to Octal

Convert decimal to octal.

Octal — base-8 — is the quieter sibling of binary and hexadecimal in computing, but it still turns up in specific corners of programming and Unix systems. This tool converts an ordinary decimal number into octal.

A base that briefly rivaled hexadecimal, then mostly lost

Like hexadecimal, octal was adopted in early computing because it's a clean power of 2 (8 = 2^3), so each octal digit maps exactly onto three binary bits — a convenient shorthand in an era when many computer architectures used word sizes divisible by 3 bits rather than 4. As computing standardized around 8-bit bytes (divisible evenly by hex's 4-bit grouping but not as cleanly by octal's 3-bit grouping), hexadecimal gradually overtook octal as the preferred binary shorthand through the 1960s and 70s — but octal never fully disappeared, surviving in specific legacy contexts.

The conversion process

The tool repeatedly divides your decimal number by 8, recording the remainder (0 through 7, since octal has no need for extended digits like hex's A-F) at each step, then reads those remainders in reverse order to build the final octal value.

Where octal notation still survives

  • Unix and Linux file permissions — the most common place anyone encounters octal today: a command like chmod 755 uses octal digits to compactly represent read, write and execute permissions for a file's owner, group and other users.
  • Older programming languages and legacy systems — some older codebases and embedded systems, particularly those built around 12-bit, 24-bit or 36-bit word architectures common in 1960s and 70s computing, used octal natively.
  • Certain networking and telecommunications protocols — a handful of legacy protocols and lower-level system calls still reference octal values in their documentation.
  • Computer science history and education — understanding octal helps illustrate the broader concept that any base can serve as a binary shorthand, with the specific base chosen based on the underlying hardware's bit-grouping needs.

Frequently asked questions

Why did Unix file permissions end up using octal specifically? Because file permissions are naturally grouped into three sets of three binary flags each (read/write/execute for owner/group/other), and three bits map perfectly onto a single octal digit (0-7), making octal a genuinely elegant fit for this specific use case even after hex became dominant elsewhere.

Does a leading zero always mean a number is octal? In several older programming languages, yes — a leading 0 before a number (like 0755) traditionally signaled octal interpretation, a convention that has caused real, hard-to-spot bugs when programmers accidentally added a leading zero to a number expecting decimal interpretation.

Is octal more or less compact than hexadecimal? Less compact — since each octal digit only represents 3 bits versus hex's 4, the same binary value requires more octal digits than hex digits to represent, which is part of why hex ultimately became the more popular general-purpose choice.

Further reading