> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# crypt.base64decode

Decodes a Base64 string back to the original bytes.

```luau theme={null}
crypt.base64decode(data: string): string
```

Reverses `crypt.base64encode`. Give it valid Base64 and you get back exactly the original data, byte for byte.

## Parameters

| Parameter | Type     | Description                |
| --------- | -------- | -------------------------- |
| `data`    | `string` | The Base64 text to decode. |

## Returns

`string` - the decoded bytes.

## Aliases

* `base64.decode`
* `base64_decode`
* `base64decode`
* `crypt.base64.decode`
* `crypt.base64_decode`

## Example

Read the cached value written by `crypt.base64encode` and decode it back.

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local base64decode = crypt.base64decode("Hello, world!")
  =======
  -- crypt.base64decode(data: string): string
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local blob = readfile("config.cache")

  local data = crypt.base64decode(blob)
  print(data) --> "Hello, world!"
  ```
</CodeGroup>

<Tip>
  Useful when exchanging configuration or network data.
</Tip>
