---
url: /process-functions/datasource-base64Bytes.md
description: Decodes a base64 string into an array of bytes.
---

# datasource.base64Bytes&#x20;

Decodes a base64 string into an array of bytes.

```js
datasource.base64Bytes(base64)
```

## Parameters

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

## Returns

The decoded bytes, each a value from 0 to 255. Pass them to [datasource.writeFile](/process-functions/datasource-writeFile) to save them to a file.

## Examples

```js
const myBase64String = "SGVsbG8gV29ybGQ="; // Hello World
const decodedBytes = datasource.base64Bytes(myBase64String);
// decodedBytes would be a byte array of the following in this example.
// [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]
```
