---
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: 504
product: Flux
version: v0
---

# hex.bytes() function

-   Flux 0.131.0+
-   View InfluxDB support

`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

```js
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/)
