# Base64.toBytes

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

## Imports

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

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

## Examples

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

const value = Base64.toBytes('aGVsbG8gd29ybGQ=')
// @log: Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])
```

## Definition

```ts
function toBytes(
  value: string,
): Bytes.Bytes
```

**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 [`Bytes.Bytes`](/api/Bytes/types#bytes).

`Bytes.Bytes`
