Base64 encoder and decoder

Encode text to Base64 or decode it back, in the standard or URL-safe alphabet.

Input

The text to encode, or the Base64 to decode.
Encode text to Base64, or decode Base64 to text.
Alphabet for encoding. "url-safe" uses - and _ in place of + and /. Decoding accepts both.
Keep the trailing "=" padding when encoding.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/base64 \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"Hello, World!"}}'
import json, urllib.request

body = {'input': {'text': 'Hello, World!'}}
request = urllib.request.Request("https://setget.net/v1/tools/base64", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/base64", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"Hello, World!"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "base64",
  "input": {
    "text": "Hello, World!"
  }
}
{
  "input": {
    "text": "Hello, World!"
  }
}

Endpoint: POST /v1/tools/base64. Over MCP: run_tool with slug: "base64". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The text to encode, or the Base64 to decode.
action string no Encode text to Base64, or decode Base64 to text. One of: encode, decode. Default: "encode".
variant string no Alphabet for encoding. "url-safe" uses - and _ in place of + and /. Decoding accepts both. One of: standard, url-safe. Default: "standard".
padding boolean no Keep the trailing "=" padding when encoding. Default: true.

Examples

Input
{
  "text": "Hello, World!"
}
Result
{
  "text": "SGVsbG8sIFdvcmxkIQ==",
  "bytes": 13
}

Decoding without padding

Input
{
  "text": "SGVsbG8sIFdvcmxkIQ",
  "action": "decode"
}
Result
{
  "text": "Hello, World!",
  "encoding": "utf-8",
  "binary": false,
  "bytes": 13
}

URL-safe, no padding

Input
{
  "text": "subjects?_d=1",
  "variant": "url-safe",
  "padding": false
}
Result
{
  "text": "c3ViamVjdHM_X2Q9MQ",
  "bytes": 13
}

Questions

Is Base64 encryption?
No. Anyone can decode it. Base64 only makes data safe to carry as text; it hides nothing.
What if the decoded data is not text?
Bytes that are not valid UTF-8 are returned as hex, with "binary" set to true.
Do I need the "=" signs to decode?
No. Missing padding, line breaks and spaces are all accepted.