HEX2BIN in Collabora Office: Expand Hexadecimal Fields into Explicit Binary Text
Expand hexadecimal strings to padded binary in Collabora Calc, check four-bit groups and preserve a clearly defined byte layout.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: HEX2BIN returns binary text for a hexadecimal string. The official control =HEX2BIN("6a";8) returns 01101010. Explicit Places keeps the intended output width visible.
Availability and version history
- Introduced: the original Collabora release and launch date are not established by the reviewed sources.
- Availability: documented in Collabora Office 26.04 desktop help.
- Platform scope: online and mobile deployment support is not inferred from the desktop documentation.
- Checked: October 14, 2026. Function-specific documentation and independent controls; no native Collabora execution.
Syntax and input contract
=HEX2BIN(Number [; Places])
Number is a hexadecimal string with at most ten characters. The source describes a sign bit and two’s-complement input for negative representations. Places is the optional number of output positions.
A ten-character input allowance does not prove that every such value fits every binary output width. The cited section does not state the complete conversion interval, omitted-width default, overflow behavior or native error codes. The worked examples use small positive values and sufficient explicit widths.
Hex digits A–F represent 10–15. The official lowercase “6a” example directly supports that spelling for its control; the tutorial’s other constants use uppercase for consistent readability.
Example 1: expand a small import
Format A2:A6 as Text and enter the strings below. In B2 use =HEX2BIN(A2;8) and fill through B6.
| Hex text | Expected binary string | Decimal control |
|---|---|---|
| 05 | 00000101 | 5 |
| 2A | 00101010 | 42 |
| 6a | 01101010 | 106 |
| B3 | 10110011 | 179 |
| FF | 11111111 | 255 |
The decimal column is explanatory. =HEX2DEC(A2) in C2 and filled down provides the independent expected numeric sequence 5, 42, 106, 179 and 255.
Hex B3 groups as B and 3, or binary 1011 and 0011. Concatenating those groups gives 10110011. This preserves eight output positions instead of dropping the leading zeros of individual groups.
Example 2: decode the same quantity two ways
If the first table’s binary output is in B2:B6, put =BIN2DEC(B2) in D2 and fill down. Expected results match C2:C6.
=HEX2DEC("2A")
=BIN2DEC(HEX2BIN("2A";8))
Both independently expected results are 42. This checks a chain of interpretations for the explicitly chosen positive input. It is not evidence that arbitrary large or negative values can pass through the same chain.
The eight-bit all-ones output represents positive 255 in BIN2DEC’s documented ten-bit signed format. Do not apply an unrelated signed-byte convention just because the display has eight bits.
Advanced example: inspect two four-bit fields
A record specification defines hex B3 as two separate fields. Put B3 in E2 as text. Use:
=HEX2BIN(LEFT(E2;1);4)
=HEX2BIN(RIGHT(E2;1);4)
Expected strings are 1011 and 0011. Their numeric field values, obtained through HEX2DEC on the same single-character substrings, are 11 and 3.
The complete quantity is 11×16+3=179. The simple sum 11+3=14 has a different meaning. LEFT and RIGHT implement the declared boundaries; they do not discover an unknown record layout.
Advanced check: preserve a wider presentation
For the small value 42:
=HEX2BIN("2A";6)
=HEX2BIN("2A";8)
=HEX2BIN("2A";10)
The expected strings are 101010, 00101010 and 0000101010. Each is independently decoded to 42. A width of ten in this positive example adds leading zeros; it does not set the sign bit.
A reverse representation check =BIN2HEX("00101010";2) yields expected text 2A, using BIN2HEX under its own documented ten-bit input contract.
Safe boundaries and common mistakes
Keep hex input as text before entry when it contains only decimal-looking digits or leading zeros. An unquoted token such as 2A is not a valid numeric constant in an ordinary formula; write the string “2A” or reference its cell.
The source’s maximum input length must not be mistaken for a guaranteed output range. Negative-output encoding, fractional Places, insufficient width and exact native errors are deliberately unverified. The examples avoid those gaps while showing the complete positive record, field and round-trip calculations.
HEX2DEC is preferable when the intended result is a numeric quantity rather than a visible sequence of bits.
References and verification
Complete function-specific documentation reviewed. Outputs are independently calculated positional models or explicitly documented controls, not captured native application results. Formulas use English names and semicolon separators; optional-argument brackets describe syntax and are not typed into a working formula.