gettoolz.app

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.

Base

Binary

10101101

Octal

255

Decimal

173

Hexadecimal

AD

Binary to octal table

DecimalBinaryOctal
000
111
2102
3113
41004
51015
61106
71117
8100010
9100111
10101012
11101113
12110014
13110115
14111016
15111117
161000020
1001100100144
1271111111177
25511111111377
256100000000400
100011111010001750
1024100000000002000
4096100000000000010000
655351111111111111111177777
42949672951111111111111111111111111111111137777777777
1844674407370955161511111111111111111111111111111111111111111111111111111111111111111777777777777777777777

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.