---
title: hex.bytes() function
description: hex.bytes() converts a hexadecimal string to bytes.
url: https://docs.influxdata.com/flux/v0/stdlib/contrib/bonitoo-io/hex/bytes/
estimated_tokens: 165
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/contrib/bonitoo-io/hex/bytes/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.131.0+

InfluxDB support

> [!Important]
> `hex.bytes()` is a user-contributed function maintained by
> the [package author](#package-author-and-maintainer).

`hex.bytes()` converts a hexadecimal string to bytes.

##### Function type signature

```js
(v: string) => bytes
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### v

(Required)
String to convert.

## Examples

### Convert a hexadecimal string into bytes

```
import "contrib/bonitoo-io/hex"

hex.bytes(v: "FF5733")// Returns [255 87 51] (bytes)

```

#### Related

* [Work with bytes types](/flux/v0/data-types/basic/bytes/)
