> For the complete documentation index, see [llms.txt](https://circular-protocol.gitbook.io/standard-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://circular-protocol.gitbook.io/standard-apis/api-docs/javascript/stringtohex.md).

# stringToHex()

**Method signature**

```javascript
function stringToHex(str)
```

**Parameters**

| Name  | Type   | Description                         |
| ----- | ------ | ----------------------------------- |
| `str` | string | Any string to convert to hex format |

**Example**

```javascript
var str = "Hello, World!";

var hexString = CircularProtocolAPI.stringToHex(str);
```

**Result**

The result will be an object of type String:

```
48656c6c6f2c20576f726c6421
```
