Octal to Binary
Convert octal (base 8) numbers to binary and back.
Octal to Binary Converter
Expand octal numbers into binary bits and compress binary back into octal. Enter one number per line: 7 → 111, 755 → 111101101, 644 → 110100100, 0o17 → 1111. The result updates as you type and can be copied or downloaded.
Each octal digit is three bits
Because 8 = 2³, the conversion needs no arithmetic at all – just replace each octal digit with its three-bit pattern:
| Octal | Binary | Octal | Binary |
|---|---|---|---|
| 0 | 000 | 4 | 100 |
| 1 | 001 | 5 | 101 |
| 2 | 010 | 6 | 110 |
| 3 | 011 | 7 | 111 |
523 therefore becomes 101 010 011. When converting binary to octal, split the bits into groups of three starting from the right.
Reading file permissions as bits
The most common reason to convert octal to binary is understanding Unix permissions. chmod 750 is 111 101 000: the owner has read, write, and execute (rwx), the group has read and execute (r-x), and everyone else has nothing (---). A umask of 027 is 000 010 111, meaning write is removed for the group and all permissions are removed for others. Seeing the bits makes such masks much easier to reason about.
Options and input formats
- Pad to full bytes – pads the binary output to 8, 16, or more bits.
- Group digits – shows the output in nibbles (
0001 1110 1101) or groups octal digits in threes. - Prefix – writes
0b…or0o…literals for your code.
Input may include 0o prefixes, spaces, underscores, a minus sign, and fractional digits (0.4 octal = 0.1 binary). Values of any length are converted exactly. See also Octal to Decimal and Octal to Hex.
Frequently Asked Questions
How do I convert octal to binary?
Replace every octal digit with its 3-bit binary value (0 = 000 … 7 = 111) and join them. 25 in octal is 010 101, or 10101 without the leading zero.
What is 777 in binary?
111111111 – nine ones. As a file permission it means read, write, and execute for owner, group, and others.
Is the digit 8 valid in octal?
No. Octal only uses 0–7. The converter reports an error if it finds an 8 or 9, so typos are easy to spot.