base64hub
v1.1.0Exact Base64 for AI agents: encode, decode and validate (standard, URL-safe, data URIs).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
base64_encode Base64 encode
Encode text to Base64. The text is converted to UTF-8 bytes first, so any language and emoji work. Set url_safe for the URL- and filename-safe alphabet (- and _ instead of + and /, as in JWTs and URLs), padding=false to drop the trailing '=' characters, and wrap to break the output into lines (76 for MIME email). Returns only the Base64 string.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to encode, taken as UTF-8. |
padding | boolean | Add '=' padding at the end. |
url_safe | boolean | Use the URL-safe alphabet (- and _, RFC 4648 section 5). |
wrap | integer | Insert a line break after every N output characters. 0 = one line, 76 = MIME. |
base64_decode Base64 decode
Decode Base64 back to text. Accepts the standard and the URL-safe alphabet (even mixed), missing '=' padding, spaces and line breaks, and data URIs such as data:image/png;base64,... Returns the decoded UTF-8 text exactly. If the bytes are not valid UTF-8 (an image, compressed or encrypted data), says so and returns them as hex instead. Invalid input fails with the reason and the position of the offending character.
| Parameter | Type | Description |
|---|---|---|
data * | string | Base64 text or a data: URI. |
base64_validate Base64 validate
Check whether a string is valid Base64 and describe it, without returning the decoded content. Uses the same lenient rules as base64_decode. Returns JSON: valid, variant (standard if + or / occurs, url if - or _ occurs, mixed if both, either if neither), padded (whether the '=' padding is complete) and bytes (decoded size); or valid: false with the error base64_decode would report, such as the offending character and its position.
| Parameter | Type | Description |
|---|---|---|
data * | string | The string to check. A data: URI is accepted too. |