FormatterHQ

Octal to Binary Converter

Expand octal numbers into binary, three bits per digit. Great for seeing exactly which read, write and execute bits a chmod value sets.

Loading tool…
Ready.

How to use the Octal to Binary Converter

  1. Type an octal number (digits 0–7) in the Octal field.
  2. Set Group digits to Nibbles if you want the bits split into blocks of four.
  3. Read the binary pattern in the Binary field and copy it.

Octal to binary, three bits per digit

This octal to binary converter expands every octal digit into its 3-bit pattern. It is the clearest way to see what a Unix permission mode actually switches on, and it works for any octal number, including fractions and very long values.

Digit-by-digit expansion

Octal digit  0    1    2    3    4    5    6    7
Bits         000  001  010  011  100  101  110  111

Replace each digit and join the groups. Leading zeros of the first group are dropped in the output, so octal 12 becomes 001 010, shown as 1010.

Permission modes as bits

In a mode like 755, the digits describe the owner, the group and everyone else. Within each 3-bit group, the bits mean read (4), write (2) and execute (1).

ModeBinaryPermissions
755111 101 101rwx r-x r-x
644110 100 100rw- r-- r--
600110 000 000rw- --- ---

A fourth leading digit adds the special bits. In 4755, the extra 4 (binary 100) is the setuid bit, so the full pattern is 100 111 101 101.

Example

Input    Output
12       1010
377      11111111
644      110100100
755      111101101
17.4     1111.1

For 17.4, the fraction digit 4 expands to 100, and trailing zeros after the point are removed, leaving 1111.1.

A note on grouping

The Group digits option splits bits into blocks of four (Nibbles) or eight (Bytes), which aligns with hexadecimal, not octal. With Nibbles selected, 755 appears as 0001 1110 1101, which reads directly as 1ED in hex. Leave grouping off when you want to read permission triples, and split the digits into threes yourself as in the table above.

Input rules

  • Digits 8 and 9 are invalid and produce an error.
  • A 0o prefix or a leading zero is accepted.
  • Spaces and underscores inside a number are ignored; the field holds one number at a time.

Converting octal to binary in code

# Python
format(0o755, "b")               # '111101101'
bin(int("755", 8))               # '0b111101101'

// JavaScript
parseInt("755", 8).toString(2);  // '111101101'

# Shell with bc: set obase before ibase
echo "obase=2; ibase=8; 755" | bc

# Current mode of a file on Linux, in octal
stat -c %a script.sh

The order in the bc line matters: once ibase=8 is set, every later number is read as octal, so writing obase=2 afterwards still works, but obase=10 would silently mean eight. Setting the output base first avoids the trap.

Reading the pattern in reverse

You can also use the binary output to answer questions like "can the group write to this file?" Take the middle triple and check its middle bit: in 664 (110 110 100), the group triple is 110, so write is allowed. In 644 it is 100, so the group can only read.

To go back, use binary to octal. For the hexadecimal form of a mode, try octal to hex, and for its plain integer value, octal to decimal.

Frequently asked questions

What is 755 in binary?
Octal 755 is 111101101 in binary, read as 111 101 101. Those three groups are rwx, r-x and r-x.
How many bits does each octal digit use?
Exactly three, because 2^3 = 8. A three-digit permission mode therefore describes nine bits.
Why is my output missing leading zeros?
The converter prints the shortest binary form, so octal 12 gives 1010 rather than 001010. Pad the result on the left if you need a fixed width, or turn on grouping to pad to multiples of four.
What does the fourth digit in 4755 or 2755 mean?
It holds the special mode bits: 4 is setuid, 2 is setgid and 1 is the sticky bit. Converting 4755 shows them as an extra 3-bit group in front: 100 111 101 101.

Last updated October 3, 2026

Guides

Related tools