Contact

BIN2HEX Function (Calligra Sheets)

Engineering Intermediate Calligra Sheets

Convert binary text to uppercase hexadecimal in Calligra, with optional padding, reversible bit patterns and strict input-digit validation.

Verification status: Selected formulas were executed through the Calligra Sheets 25.04.2 calculation engine library. No workbook-import or GUI-cell result is claimed; 26.08.2 was source-checked only. How formula examples are checked

Quick answer: =BIN2HEX("11111111";4) gives 00FF in the tested Calligra calculation engine. Successful BIN2HEX results are text strings.

Availability and version history

  • Introduced: First release not established; the name is present in Calligra 2.4.0 source.
  • Supported in: Calligra Sheets 26.08.2, with no retirement established.
  • Scope: Desktop Sheets with the Engineering function module. Examples use English semicolon-separated formulas.
  • Checked: October 14, 2026. Formulas were executed through the official 25.04.2 engine library, with source and independent arithmetic checks. This is not GUI-cell or workbook-import evidence; 26.08.2 was source-checked, not executed.

What the result represents

BIN2HEX interprets binary digits and returns hexadecimal text representing the same nonnegative integer. Four binary positions correspond to one hexadecimal digit: 1010 is A, 1111 is F and 11111111 is FF. The grouping is a positional relationship, not a character-by-character replacement. Function help.

Syntax and arguments

=BIN2HEX(binary[;places])

Binary is required; places is optional minimum hexadecimal output length. The implementation accepts one or two arguments even though the short help syntax shows only one. The input wrapper requires a full string of 0s and 1s, so signs, spaces and prefixes are not accepted by this entry. Brackets mark optional arguments and are not entered in a formula. Registration, implementation and versioned help.

Reproducible engine examples

These outputs were obtained through Calligra 25.04.2’s Formula parser and calculation library. The ordinary conversions also match independent positional arithmetic. Backticks preserve literal leading zeroes; they are not part of the entered result.

Formula Engine result
=BIN2HEX("0") 0
=BIN2HEX("1010") A
=BIN2HEX("1111") F
=BIN2HEX("10000") 10
=BIN2HEX("11111111";4) 00FF
=BIN2HEX("111001101";4) 01CD
=BIN2HEX("1000000000") 200
=BIN2HEX("1111111111") 3FF

Practical worksheet

Put the text 11111111 in A2 and width 4 in B2. =BIN2HEX(A2;B2) returns 00FF. Places counts hexadecimal output characters, not input bits. The two leading zeroes therefore pad a two-digit hexadecimal value to four characters.

Advanced checks and field widths

The recorded round trip =HEX2BIN(BIN2HEX("111001101")) gives 111001101. Grouping the input from the right as 1, 1100 and 1101 gives 1CD; leading zeroes can be added to complete four-bit groups without changing the value.

The engine converted the ten-bit inputs “1000000000” and “1111111111” to 200 and 3FF. These are nonnegative positional values. Do not apply an undocumented sign-bit or ten-digit complement interpretation when transferring a formula from another spreadsheet.

Input boundaries and error cases

An invalid digit, leading minus sign or surrounding whitespace produced #VALUE!. A zero or negative width left the natural representation in the tested cases; width 2.9 produced two hexadecimal characters. Current outputs are uppercase even though some help examples show lowercase. A width that is too small is not a truncation instruction.

The following engine results show the specific inputs tested. They do not establish every text-format, locale or import rule.

Formula Engine result
=BIN2HEX("102") #VALUE!
=BIN2HEX("-1") #VALUE!
=BIN2HEX(" 101 ") #VALUE!
=BIN2HEX("1111";0) F
=BIN2HEX("1111";-1) F
=BIN2HEX("1111";2.9) 0F

Range and verification limits

The shared text-conversion helper narrows the numeric input to a C++ int before formatting it. These small integer examples do not establish safe conversion of arbitrary large identifiers. Validate the intended value and field width before export; do not assume another spreadsheet’s numeric limits or signed convention.

The Engineering module and conversion helper are byte-identical in the inspected 25.04.2 and 26.08.2 source files. That supports the source comparison, but does not turn these engine tests into execution of a newer binary or confirmation of its UI/import behavior.