Contact

HEX2BIN Function (Gnumeric)

Engineering Intermediate Gnumeric

Decode hexadecimal text with Gnumeric HEX2BIN, using native-tested binary outputs, width rules, prefix handling and important signed-range cautions.

Verification status: 18 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: =HEX2BIN("FF",10) returns 0011111111 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 HEX2BIN returns

HEX2BIN converts hexadecimal text into binary text. Letters A through F represent decimal 10 through 15, and letter case does not change the decoded value. Hexadecimal 1CD is decimal 461 and becomes binary 111001101. Versioned function help.

Syntax and arguments

=HEX2BIN(x[,places])

x is required. Quoted hexadecimal strings avoid treating a digit-only identifier as an ordinary decimal number. Optional places pads an ordinary positive result but is limited to ten; a supplied width that cannot hold the result raises #NUM!. 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
=HEX2BIN("0") 0
=HEX2BIN("A") 1010
=HEX2BIN("f") 1111
=HEX2BIN("FF",10) 0011111111
=HEX2BIN("1CD") 111001101
=HEX2BIN("1FF") 111111111
=HEX2BIN("200") 1000000000
=HEX2BIN("400") 10000000000

Practical worksheet

For a small hexadecimal field stored as the text 01CD in A2, enter =HEX2BIN(A2) in B2. The result 111001101 exposes the nine significant bits. If a ten-character binary field is required, use =HEX2BIN(A2,10); this cell-reference form follows the same padding rule as the literal cases.

Retain 01CD alongside the binary result. Decoding a value cannot remember that the original hexadecimal label included a leading zero.

Advanced checks and interpretation

The executed check =BIN2HEX(HEX2BIN("01CD"),4) returns 01CD. The final width argument restores the intended hexadecimal field width. This is a bounded positive-value roundtrip, not a general guarantee for all ten-character inputs.

Boundaries and troubleshooting

Do not assume an enforced signed ten-bit destination range. In 1.12.57, =HEX2BIN("200") returned 1000000000 and =HEX2BIN("400") returned 10000000000, eleven binary digits, when places was omitted. Feeding a ten-bit result beginning with 1 to a signed binary decoder can change its meaning.

The quoted input FFFFFFFFFF returned #NUM!, rather than the −1 encoding familiar from some other spreadsheet implementations. The shared string parser applies a decoded-value upper bound of 9999999999 before complement handling. The accepted prefix example “0xFF” does not imply that arbitrary punctuation, spaces or suffixes are accepted.

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
=HEX2BIN("G") #NUM!
=HEX2BIN("-1") #NUM!
=HEX2BIN(" FF ") #NUM!
=HEX2BIN("0xFF") 11111111
=HEX2BIN("") 0
=HEX2BIN(F5) #NUM!
=HEX2BIN("FF",2) #NUM!
=HEX2BIN("FFFFFFFFFF") #NUM!
=HEX2BIN("A",6.9) 001010

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.