BIN2HEX Function (Gnumeric)
Convert binary text to hexadecimal with Gnumeric BIN2HEX, including padded output, ten-bit signed values, native examples and empty-cell handling.
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: =BIN2HEX("110111",4) returns 0037 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 BIN2HEX returns
BIN2HEX decodes binary digits and returns uppercase hexadecimal text. For example, binary 110111 is decimal 55, so its hexadecimal representation is 37. The text result is a representation of the value, not a decimal number to add directly. Versioned function help.
Syntax and arguments
=BIN2HEX(x[,places])
x is required. Use quoted binary digits or a cell containing binary text. The string path permits at most ten characters. places is optional and sets a padded width for nonnegative results; it does not truncate a value to fit. 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 |
|---|---|
=BIN2HEX("0") |
0 |
=BIN2HEX("1010") |
A |
=BIN2HEX("110111") |
37 |
=BIN2HEX("110111",4) |
0037 |
=BIN2HEX("111111111") |
1FF |
=BIN2HEX("1000000000") |
FFFFFFFE00 |
=BIN2HEX("1111111111") |
FFFFFFFFFF |
=BIN2HEX("1111",4) |
000F |
Practical worksheet
For a small six-bit device field, keep the original bit string in A2 and use =BIN2HEX(A2,4) in B2. With A2 containing the text 110111, the result is 0037. Keeping the original field makes it possible to distinguish an intended six-bit value from a ten-bit signed encoding.
Four hexadecimal places are an output convention here. They do not make the original value a sixteen-bit signed input, and padding does not change 55 into another number.
Advanced checks and interpretation
The executed roundtrip =HEX2BIN(BIN2HEX("111001101")) returns 111001101. It verifies the small positive value 461, whose hexadecimal form is 1CD. A roundtrip recovers the value, but it cannot infer how many leading zeroes belonged to the original field. Save that width separately when it matters.
Boundaries and troubleshooting
Ten binary digits have a sign convention. The leading 1 in 1000000000 represents −512, not positive 512; 1111111111 represents −1. BIN2HEX therefore returns FFFFFFFE00 and FFFFFFFFFF, respectively. A nine-digit 111111111 remains positive 511 and returns 1FF.
A literal minus sign is not the way to supply a signed binary encoding. Spaces, digits other than 0 or 1, and Boolean input also fail in the shown cases. Keep the sign convention explicit when translating a protocol or identifier.
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 |
|---|---|
=BIN2HEX("102") |
#NUM! |
=BIN2HEX("-1") |
#NUM! |
=BIN2HEX(" 101 ") |
#NUM! |
=BIN2HEX("") |
0 |
=BIN2HEX(F5) |
#NUM! |
=BIN2HEX("1111",0) |
#NUM! |
=BIN2HEX("1111",11) |
#NUM! |
=BIN2HEX("1111",2.9) |
0F |
=BIN2HEX(TRUE()) |
#VALUE! |
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.