Binary to Octal Converter
CU-03Paste binary numbers, one per line, and press Binary to octal to get the same values in base 8. The second button converts octal back to binary.
Runs in your browser. Nothing is uploaded.
Numbers, one per line (binary for the first button, octal for the second)
Converted numbers
How to use it
- Type or paste binary numbers, one per line. Sample loads four, including a 58-bit one.
- Press Binary to octal. The octal numbers appear in the output, one per line.
- To go the other way, put octal numbers in the box and press Octal to binary.
- Tick the 0o prefix or show-input option if you want, then copy or download the result.
Why binary and octal go together
One octal digit stands for exactly three binary digits, so 111 101 101 in binary is 755 in octal. That tidy fit is why octal was popular on older machines and why it is still used for Unix file permissions, where each of the three digits of 755 describes read, write and execute bits for one group. This tool converts the value of the number; it does not split a permission mode into letters.
What the converter does with your input
Each line is read as one whole number and converted with BigInt, so a very long run of bits is exact. Spaces and underscores inside a number are ignored, which lets you paste 1111 0000 or 1111_0000. A leading 0b is allowed, and a minus sign is kept. Leading zeros are not preserved in the result, because the value is converted and not the text. A digit other than 0 or 1 is rejected and named.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
"102" is not a valid binary number: "2" is not a binary digit. | A binary number may only contain 0 and 1. | Correct the digit, or use the other button if the number is already octal. |
Questions people ask
How do I convert binary to octal?
Group the binary digits in threes from the right and replace each group with its octal digit. 1101 becomes 001 101, which is 15 in octal. Or paste the number here and press Binary to octal and the tool does it, even for numbers with hundreds of digits.
How do I convert octal back to binary?
Put the octal numbers in the box and press Octal to binary. Each octal digit becomes three bits, but leading zeros are dropped, so 17 gives 1111 and not 001111. The value is the same, only the padding differs.
Why does octal 755 mean something for file permissions?
Each octal digit packs three bits: read, write and execute. 7 is 111, 5 is 101. The three digits of 755 are for the owner, the group and everyone else. This page converts the number itself and does not explain permission bits.
Is there a limit on how many bits I can convert?
A single number can have up to 20,000 digits. Within that the result is exact, because the conversion uses BigInt and not floating point numbers. You can also convert many lines in one go, one number per line.
Can I enter negative binary numbers?
A leading minus sign is kept, so -101 becomes -5 in octal. This is a signed value, not a two's complement pattern. A fixed-width bit pattern such as 11111011 is read as the positive number 251, since the tool does not know the width.
About this tool
It reads binary (digits 0 and 1) and writes the same value in octal (digits 0 to 7), or the other way round with the second button. It converts whole numbers only, using BigInt, so a number with hundreds of digits is converted exactly. Put one number per line; spaces and underscores inside a number are ignored (so 1111 0000 is one number), a leading - or + is kept, and the prefix that matches the input base (0b, 0o or 0x) is allowed. Leading zeros are not kept in the result, because the value is converted, not the text. Fractions such as 1.5 are rejected with an error, and a digit outside the chosen base is rejected and named.