3tej home

What is Binary to Octal Converter?

binary octal Unix permissions chmod 755, base conversion binary to octal converter free 3tej calculator This tool runs entirely in your browser. No data is sent to any server, and no signup is needed.

Binary to Octal Converter

Binary (base 2) ↔ Octal (base 8) ↔ Decimal ↔ Hexadecimal. Common in low-level programming, file permissions, color codes.

Result
1

About

Binary to octal conversion expresses a base-2 (binary) value as a base-8 (octal) value by grouping bits in threes. Because 8 = 2^3, each three-bit group maps to exactly one octal digit, making the transformation lossless and visually mechanical.

Octal was the dominant compact notation on 1960s and 1970s minicomputers (the DEC PDP-8, PDP-11, and VAX architectures used 12-bit, 16-bit, and 32-bit word sizes that divided cleanly by three). Hexadecimal eventually replaced octal once 8-bit and 32-bit hardware became standard because hex divides cleanly into nibbles of four bits. Octal still anchors Unix file permissions, the tar archive format, and a few embedded toolchains where backward compatibility is non-negotiable.

How it works

Pad the binary number with leading zeros so the total bit length is a multiple of three. Slice into 3-bit groups from the right (least-significant bit). Map each group to its octal digit using the eight-entry table.

Binary 000 -> Octal 0
Binary 001 -> Octal 1
Binary 010 -> Octal 2
Binary 011 -> Octal 3
Binary 100 -> Octal 4
Binary 101 -> Octal 5
Binary 110 -> Octal 6
Binary 111 -> Octal 7

Example: 1010 1101 (8 bits)
Pad to 9 bits:  0 1010 1101
Group in 3s:    001 010 1101 -> 001 010 110 1   (right align)
Final:          0 010 101 101 -> 0 2 5 5 -> 255 octal

The reverse (octal to binary) substitutes the three-bit pattern for each octal digit. Because the mapping is one-to-one, no information is gained or lost in either direction.

Worked example

You want to set Unix file permissions to "owner read/write/execute, group read/execute, others read/execute" using chmod. What octal number do you pass, and what is the underlying bit pattern?

  1. Permissions: rwx r-x r-x.
  2. Bit mapping: each triplet becomes 3 bits where r = 4, w = 2, x = 1 (positional).
  3. Owner triplet rwx: 111 = 7.
  4. Group triplet r-x: 101 = 5.
  5. Other triplet r-x: 101 = 5.
  6. Octal: 755. Binary: 111 101 101 = 111101101 (9 bits).
Result: chmod 755 file translates to the bit mask 111101101 in the file's mode word. Common variants: chmod 644 = 110 100 100 (rw- r-- r--), chmod 700 = 111 000 000 (rwx --- ---). Octal is the natural unit because it lines up with the rwx triplets.

Reference table

Binary (8 bits)OctalDecimalUse
0000 000000No permissions / null byte
0000 011177rwx for the lowest triplet
0011 11117763rwx rwx (group + other)
0110 1101155109Default umask mode bits
0111 1110176126rw- rw- rw- (no execute)
1010 0100244164r-- r-- r-- with set-uid bit
1101 1000330216chmod 660 + sticky bit
1111 1111377255One byte saturated (uint8 max)
1 1110 1101755493Standard executable permissions
1 1010 0100644420Standard non-executable file

Common pitfalls

  • Forgetting to pad. 1011 in binary is two groups: 001 and 011 = 13 octal. Without padding you might read it as 1 + 011 = 11 octal.
  • Wrong grouping direction. Always group from the right (least-significant bit) so the rightmost binary group becomes the rightmost octal digit.
  • Mixing chmod 755 with decimal 755. Unix chmod takes octal. Decimal 755 (= 0o1363) is not the same and produces a syntactically valid but wrong permission mode.
  • C-style leading zero confusion. In C and Java, 010 is octal 8, not decimal 10. Modern languages (Python 3, Rust) use the explicit 0o prefix to avoid this.
  • Negative numbers. Octal applies to non-negative values. For negative integers, work with two's-complement bit patterns at a fixed width (16-bit, 32-bit) before converting.
  • Misreading sticky and special bits. chmod accepts 4-digit octal where the high digit holds setuid (4), setgid (2), and sticky (1). chmod 4755 sets the setuid bit on top of 755. Tools that strip the leading digit silently can corrupt this.

Related tools and glossary

Frequently asked questions

Why convert binary to octal?

Octal groups binary digits in threes because 2^3 = 8. That makes octal a denser shorthand for raw bit patterns than binary, and it cleanly encodes the rwx triplets in Unix file permissions (rwxr-xr-x = 755). Outside Unix it has largely been displaced by hexadecimal.

How do I convert binary to octal by hand?

Group the binary digits in threes from the right, padding the left with zeros if needed. Convert each 3-bit group to its octal digit (000 = 0 through 111 = 7). Example: 101011 -> 101 011 -> 5 3 -> 53 octal = 43 decimal.

Where is octal still used in 2026?

Unix and Linux file permissions (chmod, umask), the PDP-11 / VAX legacy tooling, the ELF file mode field, the tar archive format header, and several embedded toolchains. Pythonistas also see it in os.chmod(0o755). Almost all other low-level work has moved to hex.

What does the 0o prefix mean?

0o (zero, lower-case o) is the standard octal literal prefix in Python 3, Rust, and several other modern languages. C and Java use a leading zero with no letter (0755 = octal), which causes bugs when accidentally typed. The 0o spelling resolves the ambiguity.

How long can a binary input be?

The browser implementation uses JavaScript parseInt with radix 2, which is reliable up to 53 binary digits (the IEEE 754 double-precision integer ceiling, roughly 9.007 quadrillion). For longer binaries you need a BigInt or a chunk-by-chunk approach. For chmod permissions and most embedded fields, 9 to 32 bits is enough.

Sources

  • POSIX.1-2017 (IEEE Std 1003.1), chmod and umask permission-mode bit definitions.
  • Knuth D.E., The Art of Computer Programming, Vol. 2, section 4.1 (positional number systems).
  • Python Language Reference, section 2.4.5 (integer literals, 0o prefix).
  • ISO/IEC 9899:2018 (C18), section 6.4.4.1 (integer constants, octal-constant syntax).

Last updated 2026-05-28.