Decimal to Octal Converter
Convert decimal numbers to octal (base 8) instantly.
Code Examples
const decimal = 493;
const octal = decimal.toString(8); // "755"Frequently Asked Questions
How do I convert decimal to octal?
Divide the decimal number by 8 repeatedly, noting the remainders. Read the remainders in reverse order. For example, 493 gives octal 755.
Why does octal matter for Unix file permissions?
chmod uses one octal digit per permission group: 4=read, 2=write, 1=execute. chmod 644 means owner read+write (6), group read (4), others read (4). Octal maps cleanly because each digit is exactly 3 permission bits.
What is the 0o prefix?
The 0o prefix marks an octal literal in modern languages like Python, JavaScript, and Rust: 0o755 equals decimal 493. Older C-style code uses a bare leading zero (0755), which is a common source of bugs.
Related Tools
Octal to Decimal Converter
Convert octal (base 8) to decimal instantly. Arbitrary precision via BigInt, 0o prefix support, signed 8-128 bit interpretation, and step-by-step working.
Universal Base Converter & Number Inspector
Convert numbers between any bases from 2 to 36 and inspect the result: signed/unsigned views, bit width, byte order, and code snippets.
This tool runs entirely in your browser - nothing you enter is uploaded or stored.