Skip to content

Octal to Binary Converter

Convert between octal (base-8) and binary (base-2) number systems. Each octal digit maps to exactly 3 binary bits, making this essential for Unix file permissions and legacy systems.

Category: data
Use Case: Unix Permissions, Legacy Systems, Number Systems
Privacy: 100% browser-based

Octal ↔ Binary Relationship

Octal (base-8) uses digits 0-7. Each octal digit maps to exactly 3 binary bits (since 2³ = 8). This makes octal ideal for Unix file permissions, where 3 bits represent read (4), write (2), and execute (1). Example: chmod 755 = binary 111 101 101.

Conversion Options

Output format only

No prefix

3-bit group breakdown

0 octal digits

Recommended Settings

Octal to Binary Best Practices

  • Each octal digit represents exactly 3 bits: 0-7 = 000-111
  • Octal prefixes (0o, leading 0) are automatically removed when converting to binary
  • Binary is padded with leading zeros to create 3-bit groups when converting to octal
  • Use 0o prefix for modern languages (Python, ES2015+, Rust)
  • Use leading 0 (0755) for C and Unix file permissions

Common Use Cases

  • Unix permissions: chmod 755 = owner:rwx, group:rx, others:rx
  • File modes in C: S_IRUSR (0400), S_IWUSR (0200), S_IXUSR (0100)
  • Legacy assembly language and system documentation
  • Educational: learning number systems and base conversion
  • Debugging: inspecting exact bit patterns behind octal literals

Pro Tips

  • Live conversion updates automatically as you type for instant feedback
  • Swap button reverses direction and uses the current output as the new input
  • Octal prefixes (0o, 0) are stripped automatically, so you can paste them as-is
  • Binary format options (grouped/continuous) only apply when converting to binary

Most Popular

Most users convert octal permission values (like 755) to binary with grouped formatting

When to Use This Tool

Unix/Linux File Permissions

Decode octal file permission modes like 755 or 644 into their exact binary bit pattern, or go the other way when working out a chmod value from raw read/write/execute bits.

Low-Level Programming & Debugging

Convert octal literals from legacy code, file mode constants, or hardware documentation into binary to inspect exact bit patterns during debugging.

Computer Science Education

Learn the direct relationship between octal digits and 3-bit binary groups - a clear, hands-on way to understand how base-8 and base-2 map onto each other.

How It Works

1

Choose conversion direction: Octal → Binary or Binary → Octal

2

For binary output, choose format (grouped by 3 bits or continuous)

3

For octal output, select a prefix (none, 0o modern, or 0 C-style)

4

Optionally enable 'Show Conversion Steps' for a 3-bit group breakdown

5

Enter your octal or binary number in the input field

6

The tool automatically converts as you type with live preview

7

For Octal → Binary: prefixes (0o, leading 0) are stripped first

8

Each octal digit (0-7) converts to exactly 3 binary bits

9

Example: 37 → 3 (011) + 7 (111) = 011 111

10

For Binary → Octal: the binary string is padded to a multiple of 3 bits if needed

11

Binary is divided into 3-bit groups from right to left

12

Each 3-bit group is converted to decimal (0-7), which is also its octal digit

13

Example: 111 101 101 → 7 (111=7) + 5 (101=5) + 5 (101=5) = 755

14

Output is formatted based on settings (prefix, grouping)

15

All processing happens in your browser - your data never leaves your device

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Client-side JavaScript with base conversion algorithms and 3-bit grouping for optimal performance on modern browsers.

Open Source

Built with verified, open-source libraries. Fully transparent.

Frequently Asked Questions

How do you convert octal to binary?

Each octal digit converts to exactly 3 binary bits: 0→000, 1→001, 2→010, 3→011, 4→100, 5→101, 6→110, 7→111. Concatenate the 3-bit groups for each digit, in order, to get the full binary representation. For example, octal 37 = 011 111 = 011111.

How does binary to octal conversion work?

Binary digits are grouped into sets of 3 (since 2³ = 8), padding with leading zeros if needed. Each 3-bit group is converted to its decimal value (0-7), which is also its octal digit. For example, 111 101 101 → 7, 5, 5 → octal 755.

What do octal prefixes like 0o and 0 mean?

'0o' is the modern prefix used in Python, ECMAScript 2015+, and Rust (e.g., 0o755). A leading '0' is the traditional C-style octal prefix (e.g., 0755), and is also how Unix permissions are commonly written. No prefix is common in plain documentation. Prefixes are automatically stripped when converting from octal to binary.

Why does octal use only digits 0-7?

Octal is base-8, and 2³ = 8, so exactly 3 binary bits are needed to represent each octal digit's full range of values (0 through 7). Digits 8 and 9 are invalid in octal for the same reason hexadecimal needs letters past 9.

Can any octal or binary number be converted?

Yes. Any octal number converts to a binary string that's always a multiple of 3 bits long. Any binary number converts to octal too - if its length isn't already a multiple of 3, it's padded with leading zeros first so the grouping comes out even.

Is my data secure using this tool?

Yes! All conversions happen entirely in your browser using JavaScript. Your binary and octal data never leave your device or get uploaded anywhere - everything runs 100% client-side.