Octal converter
Convert octal to decimal, binary and hex and back. Handy for modes like 755.
Result
Settings
Result
Settings
Result
Settings
Result
Recent
Octal uses only the digits 0 to 7, and each place is worth 8 times the one to its right. Enter an octal value such as 755 or 0o17 to see it in decimal, binary and hex together, or switch the input base to go the other way. Free and quick, right in the page.
How to do it by hand
- Octal to decimal: multiply the digits by 1, 8, 64, 512 and so on from the right, then add.
- Octal to binary: write every digit as three bits, from 000 for 0 to 111 for 7.
- Decimal to octal: divide by 8 until you reach 0 and read the remainders from the bottom.
- File modes: each digit is read (4) plus write (2) plus run (1) for one group of users.
Worked examples
755 (octal)
7×64 + 5×8 + 5×1 = 448 + 40 + 5
493
17 (octal)
1×8 + 7×1
15
100 (decimal)
100 ÷ 8 = 12 r 4, 12 ÷ 8 = 1 r 4, 1 ÷ 8 = 0 r 1
144
Common mistakes
- Typing 8 or 9 into an octal value. Those digits do not exist in base 8, and the tool points at the spot.
- Forgetting that a leading 0 meant octal in older code. In old C and JavaScript, 010 can mean 8.
- Passing 644 to a script as a decimal number. chmod expects octal, and decimal 644 is a different mode.
One octal digit and file permissions
| Octal | Binary (3 bits) | rwx | Meaning |
|---|---|---|---|
| 0 | 000 | --- | nothing |
| 1 | 001 | --x | execute |
| 2 | 010 | -w- | write |
| 3 | 011 | -wx | write, execute |
| 4 | 100 | r-- | read |
| 5 | 101 | r-x | read, execute |
| 6 | 110 | rw- | read, write |
| 7 | 111 | rwx | everything |
Questions people ask
What does 755 mean for a file?
Owner 7 (read, write, run), group 5 (read, run) and everyone else 5 (read, run).
Is octal still used?
Mostly for Unix file permissions and a few older formats. Hex has taken over most other jobs.
How do I mark a value as octal?
Start it with 0o, like 0o755, or pick base 8 as the input base.