{
  "category": "Engineering functions",
  "display_name": "HEX2DEC",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.HEX2DEC",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1025,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1025,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,025 in the answer bank and 3 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,028 recorded answers",
    "workbook_corpus": {
      "cells": 3,
      "matched": 3
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/engineering.rs#L157-L157",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/engineering_radix_family.rs#L188-L190"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/engineering::radix_kind",
        "catalogue/engineering::to_decimal",
        "ported/engineering_radix_family::upper_ascii_digit_value",
        "ported/engineering_radix_family::normalize_radix_text",
        "ported/engineering_radix_family::parse_radix_text",
        "ported/engineering_radix_family::source_to_decimal_kernel"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/engineering.rs#L157-L157",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,028 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.HEX2DEC.json",
  "name": "HEX2DEC",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[DEC2HEX](FUNC.DEC2HEX.md) converts in the reverse direction. [BASE](FUNC.BASE.md) and [DECIMAL](FUNC.DECIMAL.md) provide general radix conversion with different sign rules. A full-width negative engineering encoding is not a minus-prefixed numeral; choose the pair whose sign convention fits your input.\n\n\n",
    "how-to-implement": "\nSeparate input parsing, signed interpretation and output formatting. Uppercase the source, validate its digit set and length, and accumulate `raw=raw*16+digit` with checked integer arithmetic. Only a full ten-digit source with its top bit set is negative: subtract `2^40` to obtain signed integer `v`. Return `v` as a number. The 45 example is an exact integer at every step. Do not infer sign merely from the first source character of a short encoding.\n\n\n",
    "quirks": "\nThese engineering conversions use signed fixed-width encodings, not arbitrary-length integers. The source accepts at most ten digits; a full ten-digit encoding uses 40-bit two’s complement. `FFFFFFFFFF` represents minus one. Invalid source digits or an oversized input give `#NUM!`. Quote source digits to keep leading zeros and prevent worksheet number parsing from changing the input.\n\n\n",
    "sources": "\n- [Microsoft: HEX2DEC function](https://support.microsoft.com/en-us/excel/functions/hex2dec-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/ported/engineering_radix_family.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=HEX2DEC(\"2D\")` returns `45`. All of these represent the same integer: decimal 45, binary `101101`, octal `55`, and hexadecimal `2D`.\n\nFor a negative value, `=HEX2DEC(\"FFFFFFFFD3\")` returns `-45`. Accumulation gives `1099511627731`; the full-width sign bit is set, so subtract `2^40` to get `-45`. The shorter source `\"FFD3\"` is positive `65491`.\n\n\n",
    "version-differences": "The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20430 | Windows, 64-bit, CPU not recorded | 1,025 |\n\nThe record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.HEX2DEC.json).",
    "what-it-does": "\n`HEX2DEC(number)` converts hexadecimal to decimal. The result is a numeric worksheet value.\n\n\n"
  },
  "signature": {
    "display": "HEX2DEC(number)",
    "parameters": [
      {
        "description": null,
        "name": "number",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Engineering functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Decimal value of a hexadecimal number given as text",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Converts a hexadecimal number to decimal",
        "microsoft_url": "https://support.microsoft.com/en-us/office/hex2dec-function-8c8c3155-9f37-45a5-a3ee-ee5379ef106e"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "HEX2DEC"
        },
        {
          "locale": "bg-BG",
          "name": "HEX2DEC"
        },
        {
          "locale": "cs-CZ",
          "name": "HEX2DEC"
        },
        {
          "locale": "da-DK",
          "name": "HEX.TIL.DEC"
        },
        {
          "locale": "de-DE",
          "name": "HEX2DEC"
        },
        {
          "locale": "el-GR",
          "name": "HEX2DEC"
        },
        {
          "locale": "en-AU",
          "name": "HEX2DEC"
        },
        {
          "locale": "en-GB",
          "name": "HEX2DEC"
        },
        {
          "locale": "en-US",
          "name": "HEX2DEC"
        },
        {
          "locale": "es-ES",
          "name": "HEX.A.DEC"
        },
        {
          "locale": "et-EE",
          "name": "HEX2DEC"
        },
        {
          "locale": "fi-FI",
          "name": "HEKSADES"
        },
        {
          "locale": "fr-FR",
          "name": "HEXDEC*"
        },
        {
          "locale": "he-IL",
          "name": "HEX2DEC"
        },
        {
          "locale": "hr-HR",
          "name": "HEX2DEC"
        },
        {
          "locale": "hu-HU",
          "name": "HEX.DEC"
        },
        {
          "locale": "id-ID",
          "name": "HEX2DEC"
        },
        {
          "locale": "it-IT",
          "name": "HEX2DEC"
        },
        {
          "locale": "ja-JP",
          "name": "HEX2DEC"
        },
        {
          "locale": "ko-KR",
          "name": "HEX2DEC"
        },
        {
          "locale": "lt-LT",
          "name": "HEX2DEC"
        },
        {
          "locale": "lv-LV",
          "name": "HEX2DEC"
        },
        {
          "locale": "nb-NO",
          "name": "HEX2DEC"
        },
        {
          "locale": "nl-NL",
          "name": "HEX.N.DEC"
        },
        {
          "locale": "pl-PL",
          "name": "SZESN.NA.DZIES"
        },
        {
          "locale": "pt-BR",
          "name": "HEX2DEC"
        },
        {
          "locale": "pt-PT",
          "name": "HEXADEC"
        },
        {
          "locale": "ro-RO",
          "name": "HEX2DEC"
        },
        {
          "locale": "ru-RU",
          "name": "ШЕСТН.В.ДЕС"
        },
        {
          "locale": "sk-SK",
          "name": "HEX2DEC"
        },
        {
          "locale": "sl-SI",
          "name": "HEX2DEC"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "HEX2DEC"
        },
        {
          "locale": "sv-SE",
          "name": "HEX.TILL.DEC"
        },
        {
          "locale": "th-TH",
          "name": "HEX2DEC"
        },
        {
          "locale": "tr-TR",
          "name": "HEX2DEC işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "HEX2DEC"
        },
        {
          "locale": "vi-VN",
          "name": "HEX2DEC"
        },
        {
          "locale": "zh-CN",
          "name": "HEX2DEC"
        },
        {
          "locale": "zh-HK",
          "name": "HEX2DEC"
        },
        {
          "locale": "zh-TW",
          "name": "HEX2DEC"
        }
      ],
      "signature": {
        "display": "HEX2DEC(number)",
        "parameters": [
          {
            "description": null,
            "name": "number",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "HEX2DEC",
      "version_marker": null,
      "xlcall": {
        "code": "385",
        "symbol": "xlfHex2dec"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/hex2dec-function-8c8c3155-9f37-45a5-a3ee-ee5379ef106e"
  },
  "try_it": {
    "formula": "=HEX2DEC(\"2D\")"
  },
  "url": "https://handbook.dnacalc.com/functions/HEX2DEC.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "1,025 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.HEX2DEC.json"
      ]
    }
  ]
}