Octal to Decimal Converter
Convert octal to decimal with the working shown: each digit times its power of 8, added up. Handy for Unix file permissions such as 755, and you can swap direction to convert decimal to octal.
Use the digits 0 to 7. A 0o prefix and spaces are ignored.
Enter a whole decimal number. The steps show the repeated division by 8.
| Binary | | |
|---|---|---|
| Octal | | |
| Decimal | | |
| Hex | | |
| Bit length | |
Show steps
Each digit is multiplied by its place value, which is a power of the base (2 for binary, 8 for octal, 16 for hex). The products are then added together.
Divide the decimal number by the new base again and again until the quotient is 0. The remainders, read from the bottom up, are the digits of the result.
| Digit | Position | Place value | Digit × place value |
|---|---|---|---|
| Sum | |||
| Division | Quotient | Remainder | Digit |
|---|
Convert Octal Numbers to Decimal Online
Octal (base 8) is less common than hex, but you still meet it in Unix file permissions, older computing books and number literals such as 0o755 in Python. This octal to decimal converter gives you the decimal value as you type.
The steps table multiplies every digit by its power of 8, and the table on the right shows the same value in binary and hex. Click Swap direction to convert decimal to octal, with the repeated division by 8.
How to use the octal to decimal converter
- Enter an octal number, for example
755. Digits 8 and 9 are not allowed in octal. - Read the decimal result,
493, plus the binary and hex values. - Check the steps, or swap direction to turn a decimal number into octal.
How to convert octal to decimal by hand
Each octal position is worth 8 times the one to its right: 1, 8, 64, 512 and so on. Multiply each digit by its place value and add. For 755:
| Digit | Place value | Digit × place value |
|---|---|---|
7 | 82 = 64 | 7 × 64 = 448 |
5 | 81 = 8 | 5 × 8 = 40 |
5 | 80 = 1 | 5 × 1 = 5 |
So 448 + 40 + 5 = 493.
Powers of 8
| Power | Value | Power | Value |
|---|---|---|---|
| 80 | 1 | 85 | 32,768 |
| 81 | 8 | 86 | 262,144 |
| 82 | 64 | 87 | 2,097,152 |
| 83 | 512 | 88 | 16,777,216 |
| 84 | 4,096 | 89 | 134,217,728 |
Octal file permissions (chmod)
Unix permissions use one octal digit each for the owner, the group and everyone else. Each digit is three bits: read (4), write (2) and execute (1).
| Digit | Bits | Permission |
|---|---|---|
| 0 | 000 | --- |
| 1 | 001 | --x |
| 2 | 010 | -w- |
| 3 | 011 | -wx |
| 4 | 100 | r-- |
| 5 | 101 | r-x |
| 6 | 110 | rw- |
| 7 | 111 | rwx |
| Mode | Meaning | Decimal |
|---|---|---|
755 | rwxr-xr-x | 493 |
644 | rw-r--r-- | 420 |
600 | rw------- | 384 |
700 | rwx------ | 448 |
664 | rw-rw-r-- | 436 |
777 | rwxrwxrwx | 511 |
The decimal value is what some APIs expect: os.chmod(path, 493) in Python is the same as os.chmod(path, 0o755).
Octal to decimal examples
| Octal | Decimal | Octal | Decimal |
|---|---|---|---|
7 | 7 | 10 | 8 |
17 | 15 | 20 | 16 |
100 | 64 | 377 | 255 |
1000 | 512 | 7777 | 4,095 |
Octal numbers in programming
- Python 3 and JavaScript: write octal with
0o, as in0o755. - C, C++ and Java: a leading zero means octal, so
010is 8, not 10. This is a common source of bugs. - Octal and binary: each octal digit is exactly three bits, so 755 is 111 101 101. For 4-bit groups, use hex to binary.
Frequently Asked Questions
Common questions about converting octal numbers to decimal.
Multiply each digit by 8 raised to its position, counting from 0 on the right, and add the results. 17 is 1 × 8 + 7 = 15.
755 in octal is 7 × 64 + 5 × 8 + 5 = 493.
Octal 10 is 8 in decimal, because the second position is worth 8.
Base 8 only has eight digits, 0 to 7. After 7 comes 10, just as 9 is followed by 10 in decimal.
644 is rw-r--r--: the owner can read and write, the group and everyone else can only read. In decimal it is 420.
Click Swap direction above. The steps then show the repeated division by 8, with the remainders read from the bottom up. 493 becomes 755.
Mainly for Unix permissions and in some older file formats and systems. Hex has replaced it for most other uses.