Binary (Base 2) to Octal (Base 8) Converter

Convert binary numbers to octal.

377

11111111 (base 2) = 377 (base 8)

Digits in base 2: 0 and 1. Digits in base 8: 0 to 7.

How to convert Binary to Octal

Every positional number system works the same way: a digit is worth its own value times the base raised to the power of its position. In base 2 the place values, from the right, are 20 = 1, 21 = 2, 22 = 4 and so on.

Most pairs have no direct trick, so go through decimal, the base we all calculate in. First turn the base 2 number into decimal, then divide by 8 and read the remainders from the bottom up. Two short steps, and you can check the number in the middle.

Because 8 is a power of 2, there is a faster way that skips decimal. Split the bits into groups of 3 from the right, then replace each group with one base 8 digit.

The method

decimal value = each digit × its place value, all added upplace values in base 2: 1, 2, 4, 8, 16, and so ondivide by 8, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to first1 base 8 digit = 3 bitsdigits in base 2: 0 and 1digits in base 8: 0 to 7

Worked example 1: 101101 from binary to octal

Step 1: base 2 to decimal101101 (base 2) = 1 × 25 + 1 × 23 + 1 × 22 + 1 × 20= 32 + 8 + 4 + 1= 45Step 2: decimal to base 845 ÷ 8 = 5 remainder 55 ÷ 8 = 0 remainder 5Read the remainders from the bottom up: 55101101 (base 2) = 55 (base 8)

Remainders come out last digit first, which is why you read them from the bottom up. Digits that are 0 add nothing to the sum, so they are left out of the expansion.

Worked example 2: 11111111 from binary to octal

Step 1: base 2 to decimal11111111 (base 2) = 1 × 27 + 1 × 26 + 1 × 25 + 1 × 24 + 1 × 23 + 1 × 22 + 1 × 21 + 1 × 20= 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1= 255Step 2: decimal to base 8255 ÷ 8 = 31 remainder 731 ÷ 8 = 3 remainder 73 ÷ 8 = 0 remainder 3Read the remainders from the bottom up: 37711111111 (base 2) = 377 (base 8)

Worked example 3: 1111101000 from binary to octal

Step 1: base 2 to decimal1111101000 (base 2) = 1 × 29 + 1 × 28 + 1 × 27 + 1 × 26 + 1 × 25 + 1 × 23= 512 + 256 + 128 + 64 + 32 + 8= 1,000Step 2: decimal to base 81,000 ÷ 8 = 125 remainder 0125 ÷ 8 = 15 remainder 515 ÷ 8 = 1 remainder 71 ÷ 8 = 0 remainder 1Read the remainders from the bottom up: 17501111101000 (base 2) = 1750 (base 8)

Worked example 4: 10110101 with the bit-group shortcut

10110101 (base 2)Pad the left with zeros and split into groups of 3: 010 110 101Replace each group with its digit: 010 = 2, 110 = 6, 101 = 510110101 (base 2) = 265 (base 8)

Both bases are powers of 2, so there is no need to go through decimal. Groups of 3 bits make one base 8 digit.

Need the other direction? Open the Octal to Binary converter.

Binary to Octal examples

The decimal number 255 is written 11111111 in binary and 377 in octal.

Common Binary to Octal values
BinaryOctalDecimal
111
1022
11177
1000108
10101210
11111715
100002016
1000004032
100000010064
1100100144100
11111111377255
111110100017501000

Where Binary to Octal comes up

Binary uses only 0 and 1, because a digital circuit has two stable states: off and on. Every number a computer stores is binary underneath. You meet it when you work with bit flags, bit masks, subnet masks and low-level debugging.

Octal uses the digits 0 to 7, and each octal digit stands for exactly three bits. Unix file permissions such as chmod 755 are written in octal, and it also appears in older machine listings where word sizes divide by three.

Going to a larger base packs more value into each digit, so the result is shorter. The number 255 needs 8 digits in binary and 3 in octal.

Binary to Octal FAQ

How do I convert binary to octal?

Convert to decimal first by adding up each digit times its place value, then divide that decimal number by 8 repeatedly and read the remainders from last to first. Because both bases are powers of 2, you can also skip decimal and work with groups of bits.

Which digits does binary use?

Base 2 uses the digits 0 and 1. For example, 2 is not a valid digit in base 2.

Will the octal number be longer or shorter?

Shorter. Going to a larger base packs more value into each digit, so the result is shorter. Roughly 0.33 octal digits for every binary digit. The number 255 needs 8 digits in binary and 3 in octal.

Is there a shortcut for binary to octal?

Yes. Because 8 is a power of 2, there is a faster way that skips decimal. Split the bits into groups of 3 from the right, then replace each group with one base 8 digit.

Can I convert negative numbers or fractions?

The converter handles whole numbers, and a leading minus sign works for negatives. Fractions use a different method, where you repeatedly multiply the fractional part by the new base, and they are not supported here.