BIN2OCT in Google Sheets: Convert Binary Fields with Explicit Padding
Convert binary text to octal in Google Sheets, verify three-bit groups and avoid a contradictory omitted-width example in the official reference.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: BIN2OCT(signed_binary_number,[significant_digits]) converts signed binary text to octal. Use an explicit positive width for reproducible padded output; the official page contains an inconsistent example for an omitted width.
Availability and version history
- Introduced: first introduction date is not established by the reviewed official history; no desktop release number is inferred.
- Availability: documented in the rolling Google Sheets service; these examples use the web worksheet workflow.
- Checked: October 14, 2026; official BIN2OCT reference. Documentation and independent models, with no native Sheets execution or wider client certification.
Syntax and a documentation caution
=BIN2OCT(signed_binary_number,[significant_digits])
The input is a signed ten-bit binary value. Google gives 0111111111 and 1000000000 as the positive and negative endpoints, corresponding to 511 and −512. Valid numeric digit inputs are converted to their corresponding strings, so numeric 11111 is interpreted as binary digits, not decimal 11111.
The optional width adds leading zeros when the result requires fewer digits. A too-small width produces #NUM!; negative inputs ignore that width. The reference’s numeric-input example gives 37 for BIN2OCT("11111"), but its padding paragraph shows the same omitted-width call producing 00000037. Those two displayed widths conflict.
This guide therefore supplies explicit widths in positive worked formulas. =BIN2OCT("11111",8) has the unambiguous padded model 00000037. It does not claim that eight digits is the default, and it leaves the exact omitted-width display unresolved by that conflicting evidence.
Example 1: group positive bits in threes
Format A2:A6 as Plain text. Enter only the first column and calculate B with =BIN2OCT(A2,4), filled down. The decimal column is a check, not another input column.
| A, binary | B, width-four octal | Decimal check |
|---|---|---|
| 1101 | 0015 | 13 |
| 10101 | 0025 | 21 |
| 1000001 | 0101 | 65 |
| 11000000 | 0300 | 192 |
| 0111111111 | 0777 | 511 |
For 1000001, group from the right as 001 000 001. Each group becomes one octal digit, yielding 101. The requested fourth position adds a leading zero.
For 11000000, the padded groups are 011 000 000, yielding 300. Octal 300 represents 3×64=192. This grouping is a positive-value calculation; it is not a substitute for the signed interpretation of a full ten-bit negative input.
Example 2: negative values use the signed octal representation
| Formula | Expected octal |
|---|---|
=BIN2OCT("1111111111",4) |
7777777777 |
=BIN2OCT("1111111011",4) |
7777777773 |
=BIN2OCT("1000000000",4) |
7777777000 |
These represent −1, −5 and −512. The thirty-bit octal model follows the paired OCT2DEC reference. For −5, the unsigned thirty-bit encoding is 2^30−5=1073741819, expressed in ten octal positions.
A short octal 1773 would instead represent unsigned 1019. The conversion must extend the negative sign to preserve the quantity. A valid width of four cannot override that signed representation.
Advanced example: audit both sides of a conversion
For the positive fixture, put =BIN2DEC(A2) in C2 and =OCT2DEC(B2) in D2, filling both down. Both produce 13, 21, 65, 192 and 511. Put =C2=D2 in E2; all five results are TRUE.
For a reverse check, =OCT2BIN(B2,10) produces 0000001101 on the first row. The value is still 13, although its ten-position text differs from the original four-character string.
A numeric round trip does not restore an original character width automatically. Retain the original text or store its length when that width matters to an import/export format. OCT2BIN also has a narrower output interval than all possible octal inputs.
Advanced example: add quantities rather than octal-looking digits
Enter binary text 1001001 in G2. In H2 use =BIN2OCT(G2,3), giving 111. The quantity is decimal 73. To add decimal nine and return octal, use:
=DEC2OCT(OCT2DEC(H2)+9,3)
Expected result: 122, representing decimal 82. Ordinary =H2+9 instead gives decimal 120 because the digits are coerced as ordinary numbers. Octal 120 would represent only 80.
The source explicitly warns about this silent base confusion. Decode before arithmetic and encode only the result intended for display or export.
Errors and scope
Digits other than zero and one produce documented #NUM!; =BIN2OCT("102",4) is an invalid-input control. =BIN2OCT("1000001",2) needs three octal digits and follows the too-small-width error rule.
Fractional, zero and nonnumeric widths are not resolved by this dedicated page. No behavior from Excel is imported to fill those gaps. BIN2DEC provides a separate decimal inspection step when troubleshooting an input string.
References and verification
Examples use fictional data, English function names and comma separators. Expected outputs are independent mathematical calculations or explicitly documented rules, not native Sheets captures. Check the spreadsheet locale when reproducing punctuation-sensitive formulas.