Developer Bases

Decimal to octal

Decimal value
Octal 755
Divide by eight, keep the remainders
The same number elsewhere
Decimal 493
Binary 111101101
Binary, grouped 0001 1110 1101
Hexadecimal 1ED
Bits needed 9
Note
Group binary into threes
DecimalBinaryOctalHex
0000
1111
81000108
10101012A
15111117F
16100002010
64100000010040
100110010014464
25511111111377FF
256100000000400100
1024100000000002000400
655351111111111111111177777FFFF
Advertisement
320 × 100

Divide repeatedly by eight and read the remainders backwards. 493 gives 755. Alternatively convert to binary and group the bits into threes from the right — each group is one octal digit.

How to convert decimal to octal

1 Enter the decimal number.
2 Read the octal result.
3 Check the binary form to see the three-bit grouping.
4 Prefix with 0o if pasting into modern code.

Going via binary is usually faster than dividing by eight. Convert to binary, group the bits into threes from the right, and read each group — the grouping is exact because 8 is 2 cubed. This is the same trick that makes hex easy, with three bits instead of four, and it works for any base that is a power of two.

Questions

755, which as Unix permissions is rwxr-xr-x.

Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING