Encode and decode Base64 and Base64URL strings with a single POST request. No crypto libraries to install — works from any language.
| Param | Required | Description |
|---|---|---|
input | Required | The string to encode or decode |
action | Required | "encode" or "decode" |
urlSafe | Optional | Use Base64URL variant (default false) |
curl -X POST "https://api-snap.com/api/base64" \
-H "Authorization: Bearer snp_your_key" \
-H "Content-Type: application/json" \
-d '{"input": "Hello World", "action": "encode"}'const res = await fetch("https://api-snap.com/api/base64", {
method: "POST",
headers: {
Authorization: "Bearer snp_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({ input: "SGVsbG8gV29ybGQ=", action: "decode" }),
});
const { output } = await res.json();import requests
r = requests.post(
"https://api-snap.com/api/base64",
json={"input": "Hello World", "action": "encode", "urlSafe": True},
headers={"Authorization": "Bearer snp_your_key"},
)
print(r.json()["output"])Encode images and fonts as Base64 data URIs for embedding in HTML and CSS
Encode binary data for safe transport in JSON API payloads
Decode Base64URL-encoded JWT segments for inspection
Encode file attachments for MIME email protocols
Base64 and Base64URL. Encode or decode. One API call.
Get Your Free API Key