Contact

BIN2OCT Function (Gnumeric)

Engineering Intermediate Gnumeric

Use Gnumeric BIN2OCT to convert binary strings to octal text, with padding, signed ten-bit examples, roundtrips and tested input boundaries.

Verification status: 17 reference, boundary and advanced-check formulas were recalculated through Gnumeric 1.12.57 ssconvert with retained native formula identities and ODF results. Independent arithmetic and 1.12.62 source were also checked; 1.12.62 was not executed. How formula examples are checked

Quick answer: =BIN2OCT("110111",4) returns 0067 in Gnumeric 1.12.57. The result is text, so leading zeroes are significant for its displayed representation.

Availability and version history

  • Introduced: First release not established.
  • Supported in: Gnumeric 1.12.62, with no retirement established.
  • Scope: Desktop Gnumeric with the Engineering plugin; English comma-separated formulas are used below.
  • Checked: October 14, 2026. The reference and boundary tables plus the explicit roundtrip or recurrence were recalculated through 1.12.57 ssconvert and compared with native formula records, source and independent arithmetic. 1.12.62 is source-checked only.

What BIN2OCT returns

BIN2OCT converts a binary digit sequence into octal text. Each octal digit corresponds to three binary positions for ordinary nonnegative values: binary 111 is octal 7, and binary 1000 is octal 10. Versioned function help.

Syntax and arguments

=BIN2OCT(x[,places])

x is required and is best supplied as quoted binary text. The string limit is ten characters, including leading zeroes. Optional places requests a padded output width. A width too small for a positive result produces an error rather than clipping the digits. Brackets mark optional arguments and are not typed into the formula. Function implementation.

Reproducible examples

Backticks preserve the exact digits and padding; text encodings are not decimal quantities. All eight reference rows below were recalculated in the stated 1.12.57 build.

Formula Gnumeric 1.12.57 result
=BIN2OCT("0") 0
=BIN2OCT("111") 7
=BIN2OCT("1000") 10
=BIN2OCT("110111",4) 0067
=BIN2OCT("111111111") 777
=BIN2OCT("1000000000") 7777777000
=BIN2OCT("1111111111") 7777777777
=BIN2OCT("1111",4) 0017

Practical worksheet

For a compact representation of a six-bit field, place the text 110111 in A2 and enter =BIN2OCT(A2,4) in B2. The output is 0067: 6×8+7=55. This is a conversion between representations, not division of the displayed decimal number 110111 by 8.

Keep B2 as text when exporting a fixed-width field. A later import that changes 0067 to numeric 67 loses the padding and can also obscure the fact that the original field was octal.

Advanced checks and interpretation

The native check =OCT2BIN(BIN2OCT("111001101")) returns 111001101. The intermediate octal representation is 715 because 7×64+1×8+5=461. The check is useful for ordinary positive fields; it is not evidence that every signed source value fits the destination function’s limits.

Boundaries and troubleshooting

The ten-bit signed input rule matters: 1000000000 is −512 and returns 7777777000; 1111111111 is −1 and returns 7777777777. These are ten-digit octal complements, not positive quantities. Nine binary ones represent positive 511 and return 777.

The input string 00000000001 contains eleven characters and is rejected even though its mathematical value is 1. Remove padding only after deciding whether field width carries meaning in the source data.

In the following tests F5 is an actually empty cell. The empty string "", when present, is an explicit string argument.

Formula Gnumeric 1.12.57 result
=BIN2OCT("102") #NUM!
=BIN2OCT("00000000001") #NUM!
=BIN2OCT(" 111 ") #NUM!
=BIN2OCT("") 0
=BIN2OCT(F5) #NUM!
=BIN2OCT("1111",1) #NUM!
=BIN2OCT("1111",11) #NUM!
=BIN2OCT("1111",3.9) 017

Conversion and version limits

The shared conversion helper controls parsing, complement handling and width checks. The individual function entry is unchanged between the inspected 1.12.57 and 1.12.62 sources, but the shared digit-extraction helper changed. These native results therefore establish 1.12.57, not automatic equivalence for every 1.12.62 boundary. A stale SUM cache and an uncached SUM formula both recalculated correctly, with original function identities retained. Other locales, GUI entry and extreme values beyond the listed cases were not tested.