# Hex.validate

Checks if the given value is [`Hex.Hex`](/api/Hex/types#hex).

## Imports

:::code-group
```ts [Named]
import { Hex } from 'ox'
```

```ts [Entrypoint]
import * as Hex from 'ox/Hex'
```
:::

## Examples

```ts twoslash
import { Bytes, Hex } from 'ox'

Hex.validate('0xdeadbeef')
// @log: true

Hex.validate(Bytes.from([1, 2, 3]))
// @log: false
```

## Definition

```ts
function validate(
  value: unknown,
  options?: validate.Options,
): value is Hex
```

**Source:** [src/core/Hex.ts](https://github.com/wevm/ox/blob/main/src/core/Hex.ts#L1003)

## Parameters

### value

* **Type:** `unknown`

The value to check.

### options

* **Type:** `validate.Options`
* **Optional**

Options.

#### options.strict

* **Type:** `boolean`
* **Optional**

Checks if the [`Hex.Hex`](/api/Hex/types#hex) value contains invalid hexadecimal characters.

## Return Type

`true` if the value is a [`Hex.Hex`](/api/Hex/types#hex), `false` otherwise.

`value is Hex`
