HEX2DEC Function in ONLYOFFICE Spreadsheet Editor: Syntax, Examples and Troubleshooting
Learn HEX2DEC in ONLYOFFICE Spreadsheet Editor: convert hexadecimal digits to decimal, vendor syntax, reproducible spreadsheet examples, advanced uses, errors, version/locale caveats and official references.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
Quick answer
Decode a base-16 numeral into a decimal number. Hexadecimal digits 0–9 and A–F represent values zero through fifteen. The formula is =HEX2DEC(number) according to the ONLYOFFICE HEX2DEC help article. All worked outputs below are mathematical expectations obtained independently; none is an observed result from a running copy of ONLYOFFICE.
What HEX2DEC does
Decode a base-16 numeral into a decimal number. Hexadecimal digits 0–9 and A–F represent values zero through fifteen. Each hexadecimal position is worth a power of 16, counted from the right (1, 16, 256, …); letters A through F mean 10 through 15. The official function reference categorizes HEX2DEC as an engineering function.
This is a base conversion, not a change to a worksheet’s number formatting. Keep original values alongside their converted equivalents so readers can audit the conversion. The expected results are decimal numbers (no fixed output width). Leading zeros in the input string are not preserved in the output.
Official syntax, argument order, types and defaults
=HEX2DEC(number)
| Argument | Required? | Type/input | Default | Meaning and cautions |
|---|---|---|---|---|
number |
Required | Hexadecimal numeral as formula argument or cell reference | — | ONLYOFFICE documents #NUM! for an invalid hexadecimal value or more than 10 characters. |
The argument order is one required number argument. This function has no optional width argument. Exact source: ONLYOFFICE HEX2DEC function, checked 2026-10-13.
These examples use short, nonnegative hexadecimal inputs; they do not establish the undocumented signed interpretation of full-width inputs. Decimal-base integers are not automatically binary or hexadecimal strings just because they contain digit characters. A quoted formula literal such as "1010" prevents loss of leading zeros in the expression; cell data may require Text formatting. Do not assume that text coercion, whitespace, lowercase input, signed encodings, or fractional inputs behave exactly like Excel or another editor.
Reproduce the worksheet step by step
- Open a blank spreadsheet in the editor you plan to support and create headers A1 = Use case, B1 = Input, C1 = Formula / result. Treat these columns as a self-contained audit worksheet.
- Enter all B2:B17 as Text before typing the values to prevent loss of leading zeros and to preserve any A–F digits.
- Type the source values in column B exactly as shown. In C2, enter
=HEX2DEC(B2), and then fill down through C17. Verify the function name using the editor’s Formula tab, Insert Function dialog orShift+F3, as described in the official formula-entry guide. - Compare displayed values against the independent mathematical expectations below. Record the program edition, version, operating system and formula language if native results differ; this manuscript contains no native execution data.
- Keep the unconverted column unchanged so that original inputs remain available for comparison.
| Row | Use case (A) | Input (B) | Formula for C | Independent expected C |
|---|---|---|---|---|
| 2 | Zero value | 0 (Text) |
=HEX2DEC(B2) |
0 |
| 3 | Single digit | 1 (Text) |
=HEX2DEC(B3) |
1 |
| 4 | Nine | 9 (Text) |
=HEX2DEC(B4) |
9 |
| 5 | Ten in hex | A (Text) |
=HEX2DEC(B5) |
10 |
| 6 | Fifteen in hex | F (Text) |
=HEX2DEC(B6) |
15 |
| 7 | Sixteen | 10 (Text) |
=HEX2DEC(B7) |
16 |
| 8 | Twenty-six | 1A (Text) |
=HEX2DEC(B8) |
26 |
| 9 | Forty-two | 2A (Text) |
=HEX2DEC(B9) |
42 |
| 10 | Sixty-three | 3F (Text) |
=HEX2DEC(B10) |
63 |
| 11 | Sixty-four | 40 (Text) |
=HEX2DEC(B11) |
64 |
| 12 | One hundred twenty-seven | 7F (Text) |
=HEX2DEC(B12) |
127 |
| 13 | One hundred twenty-eight | 80 (Text) |
=HEX2DEC(B13) |
128 |
| 14 | One-byte maximum | FF (Text) |
=HEX2DEC(B14) |
255 |
| 15 | One hundred hex | 100 (Text) |
=HEX2DEC(B15) |
256 |
| 16 | Three-digit mixed hex | ABC (Text) |
=HEX2DEC(B16) |
2748 |
| 17 | Leading-zero identifier | 0ABC (Text) |
=HEX2DEC(B17) |
2748 |
Ready-to-paste formulas
The following use literal inputs rather than cell references. Quotes mark a base representation as text where applicable; the expected results are calculated independently using powers of the base.
| Formula | Independent expected result |
|---|---|
=HEX2DEC("0") |
0 |
=HEX2DEC("1") |
1 |
=HEX2DEC("9") |
9 |
=HEX2DEC("A") |
10 |
=HEX2DEC("F") |
15 |
=HEX2DEC("10") |
16 |
=HEX2DEC("1A") |
26 |
=HEX2DEC("2A") |
42 |
=HEX2DEC("3F") |
63 |
=HEX2DEC("40") |
64 |
=HEX2DEC("7F") |
127 |
=HEX2DEC("80") |
128 |
=HEX2DEC("FF") |
255 |
=HEX2DEC("100") |
256 |
=HEX2DEC("ABC") |
2748 |
=HEX2DEC("0ABC") |
2748 |
Mathematical verification method: For conversion to decimal, evaluate the position weights in base 2 or 16. For conversion from decimal, repeatedly divide by the target base and read remainders from right to left (or equivalently compute the exact integer base representation). For text width, add leading zeros without changing the magnitude. These are not tests executed by ONLYOFFICE.
Advanced applications and real-world interpretation
Decode a hexadecimal colour channel
An 8-bit hexadecimal channel 7F represents decimal 127. =HEX2DEC("7F") has independent expected output 127 because 7×16 + 15 = 127. Each colour channel is a separate value; this example is not a complete colour parser.
Convert a packed value into decimal
For a sample diagnostic code 2A, =HEX2DEC("2A") mathematically produces 42. Preserve the original identifier in a separate text column so reviewers can distinguish the displayed base-16 code from the converted base-10 number.
Round-trip with padding
=DEC2HEX(HEX2DEC("00FF"),4) mathematically produces 00FF (subject to actual display/case in the editor). Without width 4, minimal output is the two-character FF; leading zeros belong to formatting, not magnitude.
General radix decoder
=DECIMAL("2A",16) independently represents 42 as well, but DECIMAL has different documented length rules. Do not use that equality to infer that HEX2DEC accepts arbitrarily long inputs.
Errors, edge cases and troubleshooting
| Symptom / diagnostic formula | Evidence-based explanation and action |
|---|---|
=HEX2DEC("GG") |
#NUM! for a non-hexadecimal character; explicitly documented. |
=HEX2DEC("123456789AB") |
#NUM! for more than 10 characters; explicitly documented. |
| Formula name is not available | Check the function search under Formula > Insert Function for the installed edition; the current online help catalogue alone is not proof of support in an old build. See official function entry. |
| Formula is displayed instead of a computed value | Confirm the leading =, cell type and Show Formulas setting; use the editor’s Formula tab or the Function Arguments wizard. Vendor’s function-entry instructions. |
| Wrong zeros, unexpected text or unintended formatting | Confirm inputs were stored as intended, especially leading zeros; inspect quotes, numeric display format and the optional width, if applicable. Compare the underlying value separately from the displayed representation. |
| Locale-specific parsing or unknown function | The English examples use function names and commas from the official syntax entry; verify the installed formula language and regional separators under Advanced Settings. |
Do not infer undocumented limits. The official reference does not explicitly specify signed interpretation of ten-character hexadecimal input or case normalisation. The guide uses uppercase nonnegative examples and does not assert results for high-bit, sign, fractional or overflow boundaries. If a value is outside the clearly covered range, record it as needs native validation, not as a verified ONLYOFFICE output or an assumed error message. Invalid input can produce different errors depending on the case; this guide only attributes #NUM! to cases that the vendor explicitly documents.
Compatibility, languages, versions and editions
- Current reference scope: The official English, unversioned ONLYOFFICE Spreadsheet Editor catalogue lists HEX2DEC. The Insert Function documentation explains both typing formulas and choosing them from the function wizard. This is documentation confirmation, not a runtime test.
- Web/Docs versions: The ONLYOFFICE Docs changelog lists Docs 10.0.0, released 2026-10-10. This is the release context checked on 2026-10-13; it does not prove HEX2DEC was introduced then, nor establish its first-supported version.
- Desktop versions: The distinct ONLYOFFICE Desktop Editors changelog lists Desktop 9.4.0, released 2026-05-19 at the time of research. Desktop and web deployment version numbers cannot be interchanged. This source does not establish this function’s first Desktop release.
- Historical releases and editions: No full historical execution matrix was available. Do not claim working support in older Docs/Desktop builds or specific editions without a vendor release note or directly recorded native test.
- Locale and syntax: The Advanced Settings instructions say formula language and regional settings are configurable. The function-entry guide uses English names and comma argument separators. Localized function names, decimal separators, accepted text coercions, and display formatting have not been checked in a live editor.
- Excel/Sheets/LibreOffice compatibility: This page makes no execution claim about those products. Their formats, sign rules, size limits and error behaviour cannot substitute for ONLYOFFICE verification.
Related functions and checked references
Related ONLYOFFICE function documentation: DEC2HEX, BIN2DEC, HEX2BIN, BASE, DECIMAL. These vendor links were individually opened/checked on 2026-10-13.
For a base-independent representation, ONLYOFFICE documents BASE (number, radix, optional minimum length). For reading a text numeral in a specified radix, it documents DECIMAL (text, radix). These are related mathematical tools, not proof that their parameter limits or sign conventions equal those of HEX2DEC.
Sources and verification
| Claim | Authoritative source | Verified on | Evidentiary limit |
|---|---|---|---|
| Function purpose, name and exact argument order | Official HEX2DEC reference | 2026-10-13 | Unversioned English documentation, not native testing |
Documented #NUM! conditions in the error table |
Official HEX2DEC reference | 2026-10-13 | Only its expressly described situations; no invented error matrix |
| Formula wizard, leading equals sign, example separator | Official Insert Function guide | 2026-10-13 | User-interface instructions, not a test of every locale |
| Formula language and regional display/input settings | Official Advanced Settings | 2026-10-13 | Configuration guidance; no localized runtime test |
| Docs 10.0.0 release date | Official Docs changelog | 2026-10-13 | Product release context only; not first function support |
| Desktop 9.4.0 release date | Official Desktop changelog | 2026-10-13 | Product release context only; not first function support |
| Numerical values throughout this page | Independent positional-value arithmetic and exact integer radix conversion | 2026-10-13 | Not results observed in ONLYOFFICE |
Verification limitations: Native execution in Desktop or Docs web, localized formula entry, quote/text coercion, signed boundaries and runtime error capture were not performed. Check these cases in the intended version before relying on them.