Octal Converter: Octal, Binary, Decimal & Hex
Convert any number between octal, binary, decimal, and hexadecimal, instantly and precisely, with support for arbitrarily large integers.
How this octal converter works, and why Unix permissions still use base 8
Octal is base 8, built from the digits 0 through 7 only. It survives today mostly for one reason: three binary bits produce exactly eight possible values, 000 through 111, so octal maps onto binary almost as cleanly as hex does, just in groups of three bits instead of four. That is why a Unix file permission like 755 is octal rather than decimal, each digit represents exactly three permission bits, read, write, execute, for owner, group, and everyone else.
This tool converts a number between any of four bases, binary, octal, decimal, hexadecimal, using JavaScript’s BigInt type rather than ordinary numbers, so precision never degrades even on inputs with dozens of digits.
The conversion algorithm, generalized for any base
Rather than writing a separate function for every possible pair of bases, this tool converts through a single general purpose routine that reads a string in any base and produces a BigInt, then writes that BigInt back out in any target base.
| Octal | Binary (3-bit groups) | Decimal |
|---|---|---|
| 7 | 111 | 7 |
| 10 | 001 000 | 8 |
| 755 | 111 101 101 | 493 |
| 17 | 001 111 | 15 |
Where octal shows up beyond permissions
Legacy systems and old languages
Older systems including early Unix, PDP-11 assembly, and some embedded platforms used octal as the primary human-readable number format long before hex became dominant, since 8 fit their word sizes cleanly.
C-style leading-zero literals
In C, C++, and several other languages, a number literal written with a leading zero, like 017, is interpreted as octal rather than decimal, a quirk that has caused more than a few subtle bugs over the decades.
- Octal covers the history of base 8 notation and its historical use in computing.
- Unix numeric file permissions explains the chmod octal convention referenced in the example above.
- MDN: BigInt documents the arbitrary precision integer type this tool relies on for exact conversion.
Where octal still survives
Working out a chmod permission value before running it on a server, reading legacy system documentation or old assembly listings that use octal notation, debugging a C program where a leading zero accidentally turned a decimal literal into octal, and cross checking octal escape sequences in string literals against their actual character codes. Anywhere permission bits or legacy numeric literals appear, this converter turns an opaque three digit code into something you can actually verify.
FAQ: Octal Converter
Octal (base 8) is most commonly seen today in Unix and Linux file permission notation, where a permission set like 755 or 644 is an octal number representing read, write, and execute bits for the owner, group, and others. It was also historically used as a compact way to represent binary machine code before hexadecimal became more standard.
Multiply each octal digit by 8 raised to its position power (counting from 0 on the right) and sum the results. For example, octal 755 equals 7×64 + 5×8 + 5×1 = 448 + 40 + 5 = 493 in decimal, which is exactly what this tool computes automatically.
Because 2³ equals 8, every possible 3-bit binary combination (000 through 111) corresponds to exactly one octal digit (0 through 7). This clean mapping is why octal was historically popular as a human-readable shorthand for binary, grouping bits in 3s instead of the 4s used for hexadecimal.
In Unix file permissions, each octal digit represents a permission triplet (read=4, write=2, execute=1) for owner, group, and others respectively. So chmod 755 breaks down as: 7 (4+2+1, read+write+execute) for the owner, 5 (4+1, read+execute) for the group, and 5 (4+1, read+execute) for everyone else.
Yes, this tool uses JavaScript’s BigInt type internally instead of standard floating-point numbers, which means it can accurately convert integers far beyond the ~9 quadrillion safe-integer limit that regular JavaScript numbers are restricted to, with no precision loss or rounding errors.
Each base only allows specific digits: binary allows just 0 and 1, octal allows 0 through 7, decimal allows 0 through 9, and hexadecimal allows 0 through 9 plus A through F. If your input contains a digit outside the allowed range for the base you selected (like an ‘8’ while Octal is selected), the tool flags it as invalid rather than silently producing a wrong answer.
From the blog
Number theory, lightly
Base systems, primes and the statistics people get wrong.