How to use the Octal to Binary tool
- Type or paste an octal whole number, such as 755, into the Base-8 number box.
- Select Convert. To see a sample first, select Example, which converts 55.
- Read the binary digits in the Result box.
- Select Copy to copy the binary value, or Clear to enter another number.
How octal to binary conversion works
Eight is two to the third power, so one octal digit carries exactly three bits. Conversion by hand needs no arithmetic: replace each digit with its three-bit pattern from the table below and join the groups.
The tool reaches the same answer numerically. It reads the digits into an arbitrary-precision integer and prints that integer in base 2. Because the output is a number and not a padded pattern, zeros at the front are dropped: octal 17 becomes 1111, not 001111.
0 = 000 1 = 001 2 = 010 3 = 011
4 = 100 5 = 101 6 = 110 7 = 111Worked example: file mode 755
The Unix permission mode 755 splits into 7, 5 and 5. Seven is 111, five is 101, so the binary form is 111 101 101. Read as owner, group and others with one bit each for read, write and execute, that is rwxr-xr-x. This three-bits-per-digit fit is the reason permissions are written in octal.
755 → 111101101
644 → 110100100
55 → 101101
-17 → -1111Input the converter accepts
The field takes one whole number. Spaces inside the number, underscores, a plus sign and fractional points are not accepted.
- Digits 0 to 7 only. An 8 or 9 stops the conversion with a message such as Invalid base-8 digit: 8.
- An optional 0o prefix in either case, as written in Python, JavaScript and Rust.
- A plain leading zero, as in the C literal 0755. It is read as a digit and does not change the value.
- A leading minus sign. The result is the binary magnitude with a minus sign, not a two's complement pattern.
- Up to 4,096 characters after surrounding whitespace is trimmed.
Reading the output
The result is a continuous string of bits with no spaces and no 0b prefix. To recover the octal digits, group it in threes starting from the right. If you need a fixed width, such as 12 bits for a full mode with setuid, setgid and sticky bits, pad zeros on the left yourself or run the result through the Binary Word size Converter.
Frequently asked questions
How do you convert octal to binary by hand?
Write each octal digit as three bits and concatenate them. For 27, the digit 2 is 010 and 7 is 111, giving 010111. Drop the leading zero to get 10111, which is what this converter prints.
Why does the result have fewer than three bits per digit?
The converter prints a number, so leading zeros are removed. Octal 1 converts to 1 and octal 17 to 1111. Every digit after the first always contributes its full three bits.
Does the tool accept the 0o prefix?
Yes. 0o755 and 0O755 convert the same as 755. The prefixes 0x and 0b belong to other bases and cause an invalid digit error here.
Can I convert a negative octal number?
Yes. Put a minus sign in front, for example -55, and the result is -101101. The sign is carried over as text. The tool does not produce a two's complement bit pattern of a chosen width.
Is there a size limit?
The input can be up to 4,096 characters long. The math uses big integers, so a 4,096-digit octal number converts exactly to a binary string of up to 12,288 bits.
Can it convert octal fractions such as 7.5?
No. Only whole numbers are supported. A decimal point is reported as an invalid base-8 digit, so convert the integer and fractional parts separately by hand if you need them.