--- title: fromUtf8 description: "Convert a UTF-8 string to its hexadecimal representation; the inverse toUtf8 helper is also available." keywords: ["fromutf8", "utils", "utf8 to hex", "string to hex", "tronweb"] --- # fromUtf8 Helper function that will convert UTF8 to HEX. And `toUtf8` function is also available. ### Usage ```JavaScript TronWeb.fromUtf8(value) ``` ### Parameter | Parameter | Description | Data Type | | --------- | ------------------------- | --------- | | value | The value to be converted | String | ### Returns String - The converted HEX value. ### Example ```JavaScript TronWeb.fromUtf8("test") // output-start "0x74657374" // output-end ```