1. Home
  2. Developer tools
  3. Binary to Octal

Binary to Octal

Octal is base 8, so every three bits make one octal digit. Paste a bit string and the page groups it from the right, shows each triple next to its digit and gives the octal result.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Binary to Octal

  1. Paste binary numbers, one per line.
  2. Read the octal result and the three-bit groups.
  3. Copy it, with an optional 0o prefix.

Features

  • Shows each triple of bits with its octal digit
  • Pads the left with zeros automatically
  • Fractions group from the point outward
  • Works for any length
  • Optional 0o prefix
  • Decimal and hex values shown too

Supported formats

Input

  • Binary numbers
  • Typed or pasted numbers

You get

  • Octal
  • Bit-group table

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Binary to Octal is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Numbers are read in the base named by the tool, so a digit outside that base is reported instead of guessed.
  • Prefixes and separators (0x, 0b, 0o, spaces, underscores) are accepted, but letters and symbols outside the base are errors.

Guide

Binary to octal: grouping bits in threes

Octal is base 8, and because 8 is two to the third power, a single octal digit covers exactly three bits. Before hexadecimal took over as the programmer’s shorthand, octal was the way to write machine words on computers whose word length was a multiple of three. Today you meet it mostly in Unix permissions, but the grouping trick is a standard exercise and a useful way to check your understanding of number bases.

The three-bit rule

Start at the binary point and cut the bit string into groups of three, moving outward. Where a group is short, pad it with zeros on the outer side. Then read each group as a number from 0 to 7: 000 is 0, 001 is 1, 010 is 2, 011 is 3, 100 is 4, 101 is 5, 110 is 6 and 111 is 7. The octal number is the digits in the same order as the groups.

Reading the working

Switch on “Show the working” and the page prints the padded bits, the groups, and the digit each one stands for, with the point kept in place. This makes the padding visible: a 9-bit input needs none, an 8-bit one gets one zero in front, and a 7-bit one gets two. The extra box under the result shows the same value as a decimal number, as hexadecimal and in base 36, so you can compare four representations of one quantity.

Options

Add the 0o prefix if you want the Python and modern JavaScript spelling of an octal literal. Leave it off for the plain digits that chmod takes. Grouping splits very long results into blocks. As with the other converters, several numbers can be pasted one per line, and a character that is not 0 or 1 is flagged with its position.

Edge cases

A leading zero group is not displayed: 000 111 gives 7, not 07. If you need the four-digit mode used by tools that accept a setuid or sticky bit, add the leading digit yourself. Negative numbers keep the minus sign and are not converted to a complement. Fractions are padded on the right, so binary 0.1 becomes 0.100 and the octal value is 0.4.

A worked example

The Sample button loads 11010110.101. Grouped from the point outward, the integer bits are padded to 011 010 110 and read as 3, 2 and 6. The fraction bits 101 are already three long and read as 5. The answer is 326.5. In decimal this is 214.625: 3 × 64 is 192, plus 2 × 8 is 16, plus 6, which is 214, and the fraction .5 in octal is 5/8, or 0.625. The same value in hexadecimal is D6.A.

Limits

The page converts numbers only. It will not turn permission bits into a symbolic string such as rwxr-xr-x, check that a mode is sensible, or apply it to anything; the chmod calculator is built for that. It also assumes the input is plain unsigned binary, so a bit pattern that was meant as a signed value must be interpreted with the two’s complement calculator first.

Checked against the current version of the Binary to Octal on .

Frequently asked questions

How do I build a file permission mode from bits?

Write one bit each for read, write and execute for the owner, the group and everyone else, in that order, and convert each triple to a digit. The pattern 111 101 101 gives 7, 5 and 5, so the mode is 755.

What happens if the number of bits is not a multiple of three?

The leftmost group is filled with zeros up to three bits. The value 10110 becomes 010 110, which is octal 26. The added zeros are on the outside, so the number does not change.

How do I turn 110101 into octal?

Split into threes from the right: 110 101. These are 6 and 5, so the octal number is 65.

Where is octal still used?

Mainly in Unix file permissions. The mode 755 is the bits 111 101 101, read as owner rwx, group r-x, others r-x.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.