--- title: toDecimal description: "Convert a hexadecimal string into its decimal number value." keywords: ["todecimal", "utils", "hex to decimal", "convert hex", "tronweb"] --- # toDecimal Convert a hexadecimal to a decimal number ### Usage ```JavaScript TronWeb.toDecimal(value); ``` ### Parameters | Parameter | Description | Data Type | | --------- | ----------------- | --------- | | value | String-Hex string | String | ### Returns Number - The hexadecimal value represented by the passed in string. ### Example ```JavaScript TronWeb.toDecimal('0x15') // output-start 21 // output-end ```