[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › hexToUint8Array

```ts
function hexToUint8Array(value: string & Brand<"Hex">): Uint8Array;
```

Defined in: [packages/common/src/Type.ts:8980](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L8980)

Converts [Hex](https://evolu.dev/docs/api-reference/common/Type/variables/Hex) to bytes.

### Example

```ts
import { assertEqual, Hex, hexToUint8Array } from "@evolu/common";

const value = Hex.orThrow("000102ff");

assertEqual(hexToUint8Array(value), new Uint8Array([0, 1, 2, 255]));
```