Binary to Octal Converter
To convert binary to octal, group the bits in threes from the right (padding the left with zeros) and replace each group with one octal digit from 0 to 7. For example 111111111 becomes 777, and 11101101 becomes 355.
Octal result
777
Decimal value of the input: 511
Working
- Split into groups of 3 bits; each group is one octal digit (0-7).
- 111 = 7
- 111 = 7
- 111 = 7
- Join the digits: 777.
Example: 11101101 to octal
- Pad with 1 leading zero(s) so the length is a multiple of 3: 011101101.
- Split into groups of 3 bits; each group is one octal digit (0-7).
- 011 = 3
- 101 = 5
- 101 = 5
- Join the digits: 355.
- Result: 355 (decimal 237)
Why groups of three
Eight is 2 to the power 3, so one octal digit holds exactly three bits: 000 is 0, 001 is 1, up to 111 which is 7. No arithmetic is needed; you only match each group to its digit. The working shows the padding, each group and the joined result.
Padding matters. A binary number whose length is not a multiple of three gets leading zeros on the left, which do not change the value. 11101101 has eight bits, so it is padded to nine: 011 101 101.
Checking the result
Under the result the tool prints the decimal value of the input. Convert the octal answer with the octal to decimal tool and you should get the same number. Input may use spaces, underscores and an optional 0b prefix, and has no size limit.
Negative numbers: a leading minus sign is treated as a sign and the digits are converted as the absolute value, so the sign is simply kept in front of the result. This is not two’s complement, which is how processors store negative integers and which depends on a fixed bit width. The tool does not assume a width, so it never reinterprets a high bit as a sign.
Binary to octal versus binary to hex
Hex groups four bits per digit and octal three. Hex lines up with bytes (two digits per byte); octal lines up with permission triplets and some legacy systems. Both are shorthand for the same bits.
Decimal, binary, hex and octal table (0-15)
| Decimal | Binary (4-bit) | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
Frequently asked questions
- What is 1000 in binary as an octal number?
- 10: it is padded to 001 000, which is 10 in octal (decimal 8).
- What happens if the length is not divisible by 3?
- Leading zeros are added until it is. They do not change the value.
- Which digits are allowed?
- Only 0 and 1. The tool names any other character it finds.
- Why 3 bits per digit?
- Three bits can represent 8 values, which is exactly the eight octal digits 0-7.