---
title: hex.int() function
description: hex.int() converts a hexadecimal string to an integer.
url: https://docs.influxdata.com/flux/v0/stdlib/contrib/bonitoo-io/hex/int/
estimated_tokens: 496
product: Flux
version: v0
---

# hex.int() function

-   Flux 0.131.0+
-   View InfluxDB support

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

`hex.int()` converts a hexadecimal string to an integer.

##### Function type signature

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

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

## Parameters

### v

(Required) String to convert.

## Examples

### Convert hexadecimal string to integer

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

hex.int(v: "4d2")// Returns 1234

```

#### Related

-   [Work with integers](/flux/v0/data-types/basic/int/)
