What is octal?
Octal is a base-8 number system that uses the digits 0-7. Each octal digit represents exactly 3 binary bits, so octal is a compact shorthand for binary that predates hex. The most familiar use today is Unix file permissions (chmod 755), where each octal digit packs three permission bits — read, write, execute.
How does decimal to octal conversion work?
Repeatedly divide the decimal by 8 and record each remainder (0-7). Read the remainders in reverse to get the octal string. For 493: 493 ÷ 8 = 61 r5, 61 ÷ 8 = 7 r5, 7 ÷ 8 = 0 r7 → reading bottom-up gives 755. JavaScript uses (n).toString(8).
Why is octal used for file permissions?
Unix permissions are 9 bits — three groups of three (owner / group / other), each holding read / write / execute. Three bits is exactly one octal digit, so the 9-bit permission word fits in three octal digits: 755 means owner=7 (rwx), group=5 (r-x), other=5 (r-x). Octal makes the bit packing visible at a glance.
Is octal still used outside chmod?
Yes, in a few specific places: Unix umask values, certain BSD device-major numbers, traditional C escape sequences (\033 for ESC), and historical machine word formats like the PDP-8 and PDP-11. In modern day-to-day code, hex has largely replaced octal, but the chmod use keeps it culturally important.
Why does JavaScript treat 0123 specially?
In non-strict legacy JavaScript, a leading zero on a number literal (like 0123) was interpreted as octal — so 0123 = 83 decimal, not 123. Strict mode forbids this; modern code uses the explicit 0o prefix (0o123). This tool emits the unambiguous 0o prefix in its output.
What is the largest decimal I can convert?
Up to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991 = 2^53 − 1). Above that, JavaScript number precision degrades. For arbitrarily large integers, use BigInt — but octal output of huge numbers is rarely useful in practice.
How do I convert chmod 755 back to permissions?
Each digit is three bits: 7=111 (rwx), 5=101 (r-x), 5=101 (r-x). So 755 means owner can read/write/execute, group and others can read/execute but not write. To produce 755 from rwxr-xr-x manually, sum the bits: r=4, w=2, x=1, then add per group.
Is the data sent to a server?
No. All conversion happens in JavaScript inside your browser. Open DevTools → Network and confirm zero requests when you click Convert. Safe for internal IDs, configuration, or data you cannot upload to a remote server.