Binary Number to Octal Number Converter
Convert binary numbers to octal instantly with step-by-step 3-bit grouping breakdown. Supports large binary strings up to 10,000 digits.
About
Converting binary (base-2) to octal (base-8) is a direct radix mapping because 8 = 23. Each octal digit corresponds to exactly 3 binary digits. A manual conversion error in a single triplet propagates through every subsequent digit in the output, corrupting memory addresses, file permission masks, or embedded system register values. This tool groups your binary input from right to left into 3-bit clusters, left-pads the final group with zeros if necessary, and maps each cluster to its octal equivalent. It handles inputs up to 10,000 digits. The step-by-step breakdown exposes each grouping so you can verify intermediate results against your own work.
Note: this converter treats the input as an unsigned integer representation. It does not interpret sign bits, floating-point formats, or two's complement encoding. If you need signed conversion, manually separate the sign bit before converting the magnitude. Pro tip: Unix file permissions (755, 644) are octal shorthand for 3-bit read/write/execute triplets. This converter lets you inspect exactly which permission bits map to which octal digit.
Formulas
Because 8 = 23, each octal digit encodes exactly 3 binary bits. The conversion algorithm proceeds in three steps:
Step 1 - Pad: Given binary string B of length n, compute padding length p = (3 − n mod 3) mod 3. Prepend p zeros to B.
Step 2 - Group: Split padded string into k = n + p3 groups of 3 bits: g1, g2, …, gk.
Step 3 - Map: For each group gi = b2b1b0, the octal digit is oi = b2 × 4 + b1 × 2 + b0 × 1.
The final octal number is the concatenation o1o2…ok.
Where: B = input binary string, n = length of B, p = number of leading zeros added, k = total number of 3-bit groups, gi = the i-th triplet, oi = the i-th octal digit (0 - 7).
Reference Data
| Binary (3-bit) | Octal Digit | Decimal Value | Unix Permission |
|---|---|---|---|
| 000 | 0 | 0 | No permission |
| 001 | 1 | 1 | Execute only |
| 010 | 2 | 2 | Write only |
| 011 | 3 | 3 | Write + Execute |
| 100 | 4 | 4 | Read only |
| 101 | 5 | 5 | Read + Execute |
| 110 | 6 | 6 | Read + Write |
| 111 | 7 | 7 | Read + Write + Execute |
| Common Binary → Octal Examples | |||
| 1010 | 12 | 10 | - |
| 11111111 | 377 | 255 | 8-bit max (0xFF) |
| 111101101 | 755 | 493 | rwxr-xr-x |
| 110100100 | 644 | 420 | rw-r--r-- |
| 1000000000 | 1000 | 512 | Sticky bit |
| 1111111111111111 | 177777 | 65535 | 16-bit max (0xFFFF) |
| 10000000000 | 2000 | 1024 | 1 KiB |
| 100000000000 | 4000 | 2048 | 2 KiB |
| 11111111111111111111111111111111 | 37777777777 | 4294967295 | 32-bit max |
| 1 | 1 | 1 | Minimum nonzero |