๐Base64 Encoder / Decoder
Encode text to base64 or decode base64 back to text. Full UTF-8 support including emoji and non-Latin scripts.
Worked examples
Encode "Hello, world!"
GET /api/v1/dev/base64-encode?text=Hello%2C%20world!&direction=encode
Result: SGVsbG8sIHdvcmxkIQ==
Encode "hรฉllo ๐"
GET /api/v1/dev/base64-encode?text=h%C3%A9llo%20%F0%9F%8C%8D&direction=encode
Result: aMOpbGxvIPCfjI0=
Decode "SGVsbG8sIHdvcmxkIQ=="
GET /api/v1/dev/base64-encode?text=SGVsbG8sIHdvcmxkIQ%3D%3D&direction=decode
Result: Hello, world!
Machine API (x402)
$0.001 / callThis tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol โ no accounts, no API keys.
GET /api/v1/dev/base64-encode?text=Hello%2C%20world!&direction=encode HTTP/1.1
Host: agenttools-hub.vercel.app
โ 402 (payment required, instructions in headers)
โ 200 (after X-PAYMENT header; JSON body below)
{
"tool": "dev/base64-encode",
"input": {"text":"Hello, world!","direction":"encode"},
"result": { "value": null, "answer": "SGVsbG8sIHdvcmxkIQ==" }
}Agent docs: /llms.txt ยท OpenAPI spec ยท integration guide
About this tool
Convert text to base64 and back with full UTF-8 support. The same operation is available as a paid JSON API so AI agents can encode and decode without shipping their own codec.
Base64 maps every 3 bytes of input to 4 ASCII characters, padding the final group with = so the output length is a multiple of 4.
Frequently asked questions
Is base64 encryption?
No. Base64 is a reversible encoding, not encryption โ anyone can decode it. Never use it to protect secrets.
Why does my decoded output look wrong?
The input is probably not valid base64, or it contains whitespace or URL-safe characters (- and _). This tool accepts standard base64 with padding.
Does it support emoji and non-Latin text?
Yes. Input is encoded as UTF-8 before the base64 step, so any Unicode text round-trips correctly.