What is Binary to Octal Converter?
This binary to octal converter and calculator turns base-2 numbers into base 8. Octal digits run from 0 to 7, and each one stands for exactly three bits, so converting is a matter of grouping: 101 110 becomes 5 6, so binary 101110 is octal 56 (decimal 46).
Octal is less common than hex today, but it is still how Unix file permissions are written (rwxr-xr-x is 111 101 101, which is 755) and it appears in some older systems and C escape sequences. Paste one value or several separated by spaces and they are converted instantly.
How to use Binary to Octal Converter
- Enter binary values separated by spaces or commas, for example 101110
- Read the octal result.
- Choose the output separator if you converted several values.
- Copy the result, or click Swap to convert octal to binary.
Key features
- Convert many values at once, separated by spaces or commas
- Exact results for numbers of any size, including 64-bit values
- Output separated by spaces, commas, new lines or nothing
- Uppercase or lowercase hex, optional 0x prefix, and binary padded to whole 8-bit bytes
- Swap button to reverse the conversion direction
- Summary of a single value in binary, octal, decimal, hex and ASCII
- Clear errors for invalid digits; runs entirely in your browser
Common use cases
- Working out Unix file permissions from permission bits
- Learning number base conversions for exams
- Reading octal values in legacy systems and documentation
- Converting bit fields grouped in threes
- Checking C and Python octal literals
Technical details & standards
To convert by hand, split the binary number into groups of three bits from the right, pad the leftmost group with zeros, and replace each group with its digit: 000 = 0, 001 = 1, 010 = 2, 011 = 3, 100 = 4, 101 = 5, 110 = 6, 111 = 7. So 1101011 becomes 001 101 011 = 153.
Values separated by spaces or commas are converted individually, each as one whole number of any length, and a 0b prefix is accepted. The arithmetic uses arbitrary-precision integers, so long values such as 64-bit masks stay exact.
How to convert binary to octal by hand
Each octal digit stands for exactly three bits, so you only need the eight 3-bit groups in the table below. Here is 11010111:
- Split the bits into groups of three, starting from the right: 11, 010, 111.
- Pad the leftmost group with zeros to three bits: 011.
- Convert each group: 011 = 3, 010 = 2, 111 = 7.
Result: 11010111 in binary is 327 in octal. The same grouping is why chmod 755 is the bits 111 101 101.
Binary to octal conversion table
Split the bits into groups of three from the right, pad the leftmost group with zeros, and turn each group into one octal digit. The eight possible groups are listed first, with the Unix permissions they stand for, then some longer examples.
| Binary | Octal | Decimal | Notes |
|---|---|---|---|
| 000 | 0 | 0 | As permission bits: --- |
| 001 | 1 | 1 | As permission bits: --x |
| 010 | 2 | 2 | As permission bits: -w- |
| 011 | 3 | 3 | As permission bits: -wx |
| 100 | 4 | 4 | As permission bits: r-- |
| 101 | 5 | 5 | As permission bits: r-x |
| 110 | 6 | 6 | As permission bits: rw- |
| 111 | 7 | 7 | As permission bits: rwx |
| 110 | 6 | 6 | Grouped as 110 |
| 1010 | 12 | 10 | Grouped as 001 010 |
| 101101 | 55 | 45 | Grouped as 101 101 |
| 11111111 | 377 | 255 | Grouped as 011 111 111, one full byte |
| 111101101 | 755 | 493 | Grouped as 111 101 101, the bits of chmod 755 |
Frequently asked questions
How do I convert binary to octal?
Group the bits in threes from the right and convert each group to a digit from 0 to 7. 111101101 is 111 101 101, which is 755.
What is 111 in octal?
7. Three bits can represent 0 to 7, so 111 is the largest single octal digit.
Why are Unix permissions written in octal?
Each permission set (owner, group, others) has three bits, read, write and execute, which fit exactly into one octal digit. rwxr-xr-x is 111 101 101 in binary, or 755.
How do I write octal numbers in code?
Use the 0o prefix in JavaScript and Python (0o755) and a leading 0 in C (0755). In JavaScript, parseInt("755", 8) converts an octal string.