Octal to Binary Converter — Convert Octal to Binary.
Convert any octal number to binary instantly, or learn how to convert oct to bin by hand using the simple 3-bit digit expansion method. Includes worked examples and programming code snippets.
Try it: Octal to Binary Converter
Popular Octal to Binary & Linux Permission Table
Below is an instant lookup table answering top search queries like octal 20 in binary (octalbin20) and common Unix file permission codes. Click any row to load the exact conversion into the calculator above.
| Octal Query | Binary (3-bit groups) | Decimal | Meaning / Usage |
|---|---|---|---|
| octal 20 in binary | 010 000 (10000) | 16 | Top GSC searched value (octalbin20) |
| 7 | 111 | 7 | Max single octal digit (all 3 bits set) |
| 755 | 111 101 101 | 493 | Standard Unix/Linux executable chmod |
| 644 | 110 100 100 | 420 | Standard Unix/Linux file chmod |
What are octal and binary number systems?
The binary number system (base-2) uses only two digits: 0 and 1. Each binary digit represents a single bit inside a computer. It is the foundation of all digital computing because transistors in processors operate in two states (on/off). However, binary numbers are long and hard to read. For instance, the decimal number 255 requires eight binary digits: 11111111.
The octal number system (base-8) uses digits 0 through 7. Each octal numeral represents exactly three bits. It was historically popular in computing (especially on PDP-8 and UNIX systems) because it provides a compact way to represent binary data. Converting an octal numeral to binary is a straightforward process, and we show each step below.
Today, octal is still used in Unix/Linux file permission notation (like chmod 755), some assembly language contexts, and educational settings. If you need the reverse conversion, see our binary to octal converter.
The 3-bit digit expansion method.
Converting octal to binary is one of the simplest number system conversions because of the direct mathematical relationship: 8 = 2³. This means each octal digit corresponds to exactly three binary digits. No division, multiplication, or intermediate decimal conversion is needed — just a direct substitution.
- Take each octal digit separately. Process digits from left to right.
- Replace each digit with its 3-bit binary equivalent using the mapping table (0→000 through 7→111).
- Concatenate all the 3-bit groups in the same order to form the final binary number.
- Optionally remove leading zeros from the leftmost group for a cleaner representation.
Convert Octal to Binary Example & Explanations.
Example 1: Convert octal 345 to binary
- Separate the digits: 3, 4, 5
- 3 ➔
011 - 4 ➔
100 - 5 ➔
101 - Combine:
011+100+101= 011100101 (or 11100101)
Example 2: Convert octal 77 to binary
- Separate the digits: 7, 7
- 7 ➔
111 - 7 ➔
111 - Combine: 111111 (decimal 63)
Example 3: Convert octal 17 to binary
- Separate the digits: 1, 7
- 1 ➔
001 - 7 ➔
111 - Combine: 001111 (or 1111, decimal 15)
Example 4: Convert octal 0.5 to binary (fractional)
- Integer part: 0 ➔
000 - Fractional part: 5 ➔
101 - Combine with decimal point: 0.101
Example 5: Convert octal 755 to binary (Unix permissions)
- Separate the digits: 7, 5, 5
- 7 ➔
111(owner: read+write+execute) - 5 ➔
101(group: read+execute) - 5 ➔
101(others: read+execute) - Combine: 111101101
Octal to binary in programming languages.
Here's how to convert octal numbers to binary programmatically. For more code examples, see our developer code snippets page.
# Convert octal string to binary string
octal_str = "345"
decimal_val = int(octal_str, 8)
binary_str = bin(decimal_val)[2:] # Remove '0b' prefix
print(binary_str) # Output: 11100101
# One-liner with digit expansion
binary = "".join(bin(int(d, 8))[2:].zfill(3) for d in "345")
print(binary) # Output: 011100101 // Convert octal to binary via decimal intermediate
const octal = "345";
const binary = parseInt(octal, 8).toString(2);
console.log(binary); // Output: 11100101
// Digit expansion method
const map = {'0':'000','1':'001','2':'010','3':'011',
'4':'100','5':'101','6':'110','7':'111'};
const expanded = "345".split("").map(d => map[d]).join("");
console.log(expanded); // Output: 011100101 # Using bc to convert octal 345 to binary
echo "obase=2; ibase=8; 345" | bc
# Output: 11100101
# Using printf and Python one-liner
python3 -c "print(bin(0o345)[2:])"
# Output: 11100101 Frequently Asked Questions
How do you convert octal to binary? ▼
Replace each octal digit with its 3-bit binary equivalent (0=000 through 7=111), then concatenate all the groups in order. This works because octal is base-8 and 8 = 2³, so each digit maps to exactly three binary bits.
What is octal 345 in binary? ▼
Octal 345 = binary 011100101 (or 11100101). Each digit expands: 3→011, 4→100, 5→101, then concatenate to get the result.
What is octal 77 in binary? ▼
Octal 77 converts to binary 111111. Each 7 expands to 111, giving 111 + 111 = 111111 (decimal 63). This is the maximum value for a 6-bit unsigned number.
Why does each octal digit equal exactly 3 binary bits? ▼
Because 8 = 2³. An octal digit can hold values 0–7 (8 possible values), and 3 binary digits can represent the same 8 values (000–111). This is the same reason hex digits map to 4 binary bits (16 = 2⁴). The conversion is a direct substitution with no arithmetic needed.
How do you convert octal fractions to binary? ▼
The same 3-bit expansion method applies to fractional digits. Expand each digit on both sides of the decimal point into 3 binary bits. For example, octal 3.5₈ becomes 011.101₂. The radix point stays in the same position relative to the digit groups.
What is the relationship between octal and binary? ▼
Octal and binary are directly related because 8 is a power of 2. This means every octal digit maps to exactly 3 binary digits, and every group of 3 binary digits maps to one octal digit. This made octal a popular shorthand for binary in early computing, especially on systems with 12-bit, 24-bit, or 36-bit word sizes. Today, hexadecimal (4-bit groups) is more common because modern architectures use 8-bit bytes.
Octal → Binary Mapping
| Octal | 3-Bit Binary |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |