--- title: toHex --- # toHex Convert any value to HEX. **Note**: This function does not convert TRON address to Hex. If you wish to specifically convert TRX addresses to HEX, please use TronWeb.address.toHex instead. ### Usage ```JavaScript TronWeb.toHex(value); ``` ### Parameters | Parameter | Description | Data Type | | --------- | --------------------------------- | ------------------------------------------ | | value | The value to be converted to HEX. | String, Number, Object, Array or BigNumber | ### Returns String - The hexadecimal value of the passed in value. ### Example ```JavaScript TronWeb.toHex("abcABC") // output-start "0x616263414243" // output-end // If it is an object or array type, it will first be converted to a string using JSON.stringify. TronWeb.toHex({ abc: "ABC" }) // output-start "0x7b22616263223a22414243227d" // output-end ```