HEX2DEC Function (Calligra Sheets)
Read hexadecimal text as decimal numbers in Calligra, including letter case, numeric-looking inputs, prefixes and signed-text cautions.
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: =HEX2DEC("01CD") gives 461 in the tested Calligra calculation engine. Successful HEX2DEC results are numeric integers.
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
HEX2DEC interprets hexadecimal digits and returns an integer. A–F represent values ten through fifteen. For example, 01CD has value 1×256+12×16+13=461. Uppercase and lowercase letters were both accepted by the tested engine. Function help.
Syntax and arguments
=HEX2DEC(hexadecimal)
Exactly one argument is required. Prefer a quoted text value or a text cell for the hexadecimal representation. An unquoted numeric input is converted to text and then parsed as hexadecimal: HEX2DEC(255) therefore gives 597, because 2×256+5×16+5=597. It does not simply return the decimal number 255. 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 |
|---|---|
=HEX2DEC("0") |
0 |
=HEX2DEC("A") |
10 |
=HEX2DEC("FF") |
255 |
=HEX2DEC("01CD") |
461 |
=HEX2DEC("ff") |
255 |
=HEX2DEC("100") |
256 |
=HEX2DEC("FFFFFFFFFF") |
1099511627775 |
=HEX2DEC(255) |
597 |
Practical worksheet
For a hexadecimal ID stored as the text 01CD in A2, enter =HEX2DEC(A2) to obtain 461. Store the original code as well if leading zeroes or original letter case matter to an export. The numeric result supports arithmetic but no longer preserves those presentation choices.
Advanced checks and field widths
The recorded check =DEC2HEX(HEX2DEC("01CD");4) returns 01CD. This tests a small valid value and explicitly restores its width. For a case-insensitive source field, “ff” and “FF” both decode to 255.
The ten-digit sequence “FFFFFFFFFF” decoded to 1099511627775, a positive number. It was not treated as a negative ten-digit complement. If the source format uses signed hexadecimal, apply its documented sign convention rather than assuming one from a spreadsheet function name.
Input boundaries and error cases
The engine accepted “-FF”, surrounding spaces and the prefix “0xFF”, yielding −255, 255 and 255 respectively. Those are observed parser cases, not a promise that all conversion functions accept them: HEX2BIN’s wrapper rejects a sign, whitespace and that prefix. “G” and an empty string returned #VALUE!. Very long inputs can exceed the decoder or destination’s numeric range.
The following engine results show the specific inputs tested. They do not establish every text-format, locale or import rule.
| Formula | Engine result |
|---|---|
=HEX2DEC("G") |
#VALUE! |
=HEX2DEC("-FF") |
-255 |
=HEX2DEC(" FF ") |
255 |
=HEX2DEC("0xFF") |
255 |
=HEX2DEC("") |
#VALUE! |
Range and verification limits
The shared decoder parses an integer using the specified base. A successful decode is not proof that a later encoder or another application can preserve every large value. Keep original digit strings for long identifiers, and distinguish their representation from arithmetic quantities.
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.