# Base64UrlDecode()

Decodes a Base64URL-encoded string.

**Requires Extension:** [Crypto Extension](https://download.lucee.org/#17AB52DE-B300-A94B-E058FC978BE4542D)

```
Base64UrlDecode( encoded=string, charset=string );
```

**Returns:** any

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| encoded | string | Yes | Base64URL-encoded string |  |
| charset | string | No | If provided, returns decoded data as string using this charset |  |

# Examples

```cfml
// Decode a Base64URL-encoded string back to its original form
// Returns binary by default
decoded = Base64UrlDecode( "SGVsbG8gV29ybGQ" );
// decoded is a binary value
str = charsetEncode( decoded, "UTF-8" ); // "Hello World"

// Pass a charset to get a string directly
decoded = Base64UrlDecode( "SGVsbG8gV29ybGQ", "UTF-8" );
// "Hello World"

// Handles missing padding automatically (Base64URL typically omits padding)
decoded = Base64UrlDecode( "dGVzdA", "UTF-8" ); // "test"
```







# See Also

[Base64UrlEncode()](base64urlencode.md), [ToBase64()](tobase64.md), [ToBinary()](tobinary.md)