Binary to octal converter
Convert binary numbers to octal — every 3 bits become one octal digit. Exact at any size, with a worked example and a table of common values. Free, and computed in your browser.
Part of developer tools.
Binary
10101101
Octal
255
Decimal
173
Hexadecimal
AD
Binary to octal table
| Decimal | Binary | Octal |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 10 | 2 |
| 3 | 11 | 3 |
| 4 | 100 | 4 |
| 5 | 101 | 5 |
| 6 | 110 | 6 |
| 7 | 111 | 7 |
| 8 | 1000 | 10 |
| 9 | 1001 | 11 |
| 10 | 1010 | 12 |
| 11 | 1011 | 13 |
| 12 | 1100 | 14 |
| 13 | 1101 | 15 |
| 14 | 1110 | 16 |
| 15 | 1111 | 17 |
| 16 | 10000 | 20 |
| 100 | 1100100 | 144 |
| 127 | 1111111 | 177 |
| 255 | 11111111 | 377 |
| 256 | 100000000 | 400 |
| 1000 | 1111101000 | 1750 |
| 1024 | 10000000000 | 2000 |
| 4096 | 1000000000000 | 10000 |
| 65535 | 1111111111111111 | 177777 |
| 4294967295 | 11111111111111111111111111111111 | 37777777777 |
| 18446744073709551615 | 1111111111111111111111111111111111111111111111111111111111111111 | 1777777777777777777777 |
The last rows are the largest 32-bit and 64-bit unsigned values. The second is past the point where ordinary JavaScript numbers start rounding; the table and the converter above both compute with BigInt, so every digit is exact.
How to convert binary to octal
Split the binary number into groups of 3 bits, starting from the right, and pad the leftmost group with zeros if it comes up short. Each group is exactly one octal digit, because 8 = 2³: no carrying and no arithmetic across groups, just a lookup of 8 possible patterns. For 10101101: 010 101 101, the first group padded with zeros; then 010 → 2, 101 → 5, 101 → 5 — so 10101101 in binary is 255 in octal.
Binary and octal side by side
The largest 16-bit value is 1111111111111111 in binary and 177777 in octal: 16 digits against 6. Every octal digit is exactly 3 bits, so the lengths stay in a fixed ratio and any stretch of digits can be converted without looking at its neighbours. Octal survives mainly in Unix file permissions, where each digit is one read-write-execute triplet: 755 is rwx r-x r-x. In JavaScript and Python source, 173 is written 0b10101101 in binary and 0o255 in octal. Paste a prefixed number into the converter and it switches to the matching base; a number with no prefix is read in the selected base — binary on this page.
Other conversions
Going the other way? Octal to binary converter.
Or open the full number base converter and see a number in all four bases at once.