base64decode Synchronous
base64.decodebase64_decodecrypt.base64.decodecrypt.base64_decodecrypt.base64decodesyn.crypt.base64.decodesyn.crypto.base64.decode
Restore the original bytes from Base64 text. The result can be read as text or passed to a function that accepts binary strings. Use it to recover binary content received through a text format. Invalid Base64 raises an error, so handle decoding failures for user-supplied input.
Luau
base64decode(data: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
data | string | Base64 text using the standard + and / alphabet and correct = padding. |
Returns
stringThe decoded byte string, including any embedded zero bytes.
Usage notes
Malformed Base64 raises an error. Whitespace, URL-safe alphabet substitutions, and missing required padding are not accepted.
Example
Luau
local decoded = base64decode("aGVsbG8=")
print(decoded) -- hello