# Base64.toHex

Decodes a Base64-encoded string (with optional padding and/or URL-safe characters) to [`Hex.Hex`](/api/Hex/types#hex).

## Imports

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

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

## Examples

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

const value = Base64.toHex('aGVsbG8gd29ybGQ=')
// @log: 0x68656c6c6f20776f726c64
```

## Definition

```ts
function toHex(
  value: string,
): Hex.Hex
```

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

## Parameters

### value

* **Type:** `string`

The string, hex value, or byte array to encode.

## Return Type

The Base64 decoded [`Hex.Hex`](/api/Hex/types#hex).

`Hex.Hex`
