Octal
Octal is the base-8 numeral system, using digits 0-7, where each digit corresponds to 3 binary bits; it was widely used on early computers.
Purpose
It compactly represented binary on early machines whose word lengths were multiples of 3 and reads naturally in 3-bit groups; today it survives mainly in Unix file permission bits.
Mechanism
Each octal digit corresponds to 3 binary bits. Values expand by positional weight: N = d_n×8^n + ... + d_0×8^0. For example, octal 17 = 1×8 + 7 = 15 in decimal.
Use cases
- Unix file permissions (e.g., chmod 755)
- Instruction debugging on early PDP-8 / PDP-11
- JavaScript 0o-prefixed numeric literals
- C-style string escapes
Examples
- Input
493Output755Decimal 493 → octal 755, the rwxr-xr-x permission mask
Common errors
- A leading 0 making a JavaScript number parse as octal (non-strict mode)
- Use the 0o prefix to declare octal explicitly
Related terms
Hexadecimal
Hexadecimal (hex) is the base-16 numeral system, using 0-9 and A-F for 0-15; it is one of the most common radix notations in computing. GLOSSARY
Binary
Binary is the base-2 numeral system, using only 0 and 1, and is the foundation of internal data representation in all digital electronic computers. GLOSSARY