--- title: fromAscii description: "Converts an ASCII/UTF-8 string to its hex string representation prefixed with 0x." keywords: ["fromascii", "utils", "ascii to hex", "string to hex", "fromutf8"] --- # fromAscii Helper function that will convert ASCII to HEX ### Usage ```javascript TronWeb.fromUtf8(value); ``` ### Parameters | Parameter | Description | Data Type | | --------- | ---------------------- | --------- | | value | The string to be converted | string | ### Returns String - The converted hex string. ### Example ```javascript TronWeb.fromUtf8("test"); // output-start '0x74657374' // output-end ```