---
url: 'https://adk.nht.io/api/@nhtio/adk/common/functions/decodeBase64.md'
---

# Function: decodeBase64()

```ts
function decodeBase64(b64: string): Uint8Array;
```

Defined in: [src/lib/helpers/base64.ts:57](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/lib/helpers/base64.ts#L57)

Decode a base64 string back into a `Uint8Array`.

## Parameters

| Parameter | Type     | Description                  |
| --------- | -------- | ---------------------------- |
| `b64`     | `string` | The base64 string to decode. |

## Returns

`Uint8Array`

The decoded bytes.

## Remarks

Inverse of [encodeBase64](encodeBase64.md). Prefers `Buffer.from(b64, 'base64')` when `globalThis.Buffer` exists;
otherwise decodes through `atob` byte-by-byte.
