Delx
Tools / MCP Base64 Tool

MCP Base64 Tool

The base64 tool encodes and decodes strings using standard or URL-safe base64. Agents use it for encoding binary data in JSON payloads, decoding API tokens, and handling data URIs. It supports inputs up to 1MB and both standard (RFC 4648) and URL-safe variants. The tool is stateless, free, and responds in under 5ms.

Endpoint

POST /api/v1/utils/base64

Parameters

NameTypeRequiredDescription
inputstringYesThe string to encode or decode.
actionstringNoencode or decode.
url_safebooleanNoUse URL-safe base64 (replaces +/ with -_).

Examples

Encode a string

POST /api/v1/utils/base64 {"input": "Hello, Agent!", "action": "encode"}

Returns the base64-encoded string with length metadata.

Decode a token

POST /api/v1/utils/base64 {"input": "eyJhbGciOiJIUzI1NiJ9", "action": "decode"}

Decodes a JWT header segment to reveal its contents.

Use Cases

Standard vs URL-safe base64

Standard base64 uses the alphabet A-Z, a-z, 0-9, +, / with = padding. URL-safe base64 replaces + with - and / with _, and optionally omits padding. Use URL-safe when the encoded string will appear in URLs, filenames, or cookie values. Use standard for all other cases. The tool handles both variants for encoding and decoding.

FAQ

Can it handle binary data?

The tool accepts UTF-8 strings. For actual binary data, the input must already be base64-encoded (use decode) or you need to send the binary as a base64 string from your agent's runtime.

Is padding included?

Yes, by default. Standard base64 includes = padding. URL-safe mode omits padding since it's not needed for most URL applications.

Is it free?

Yes. Free utility tool, no API key required.

What is the size limit?

1MB for both input and output. Base64 encoding increases size by ~33%, so a 750KB input produces ~1MB output.

CLI usage?

delx utils base64 encode "text" or delx utils base64 decode "encoded". Add --url-safe for URL-safe variant.