Base64 encode and decode
# Encode
curl -X POST https://aisenseapi.com/services/v1/base64_encode \
-H "Content-Type: application/json" \
-d '{"data":"Hello world"}'
{ "base64_encoded_data": "SGVsbG8gd29ybGQ=" }# Decode as raw bytes
curl -X POST https://aisenseapi.com/services/v1/base64_decode \
-H "Content-Type: application/json" \
-d '{"data":"SGVsbG8gd29ybGQ="}'
Hello worldBase58 encode and decode
Base58 avoids characters that are easy to confuse in print. It is often used for compact identifiers and blockchain-related formats.
{ "data": "Hello" }
{ "base58_encoded_data": "9Ajdvzr" }Send 9Ajdvzr to /base58_decode to get the original bytes. An invalid Base58 character returns HTTP 400 with {"error":"Invalid Base58 input."}.
Base32 encode and decode
Base32 uses a smaller, case-insensitive alphabet that works well in systems where mixed case or punctuation is inconvenient.
{ "data": "Hello" }
{ "base32_encoded_data": "JBSWY3DP" }Send JBSWY3DP to /base32_decode to retrieve Hello.
Choose raw bytes or JSON
The three decode endpoints return application/octet-stream when no Accept header is sent. This is useful for files and binary data.
Send Accept: application/json when a JSON client needs a predictable envelope:
{
"type": "json",
"decoded_data": { "key": "value" }
}When the decoded bytes are not JSON, the response uses type: binary and returns the data as Base64 inside decoded_data.
Endpoint reference
| Endpoint | JSON response key |
|---|---|
| /base64_encode | base64_encoded_data |
| /base58_encode | base58_encoded_data |
| /base32_encode | base32_encoded_data |
| /base64_decode | Raw bytes or type and decoded_data |
| /base58_decode | Raw bytes or type and decoded_data |
| /base32_decode | Raw bytes or type and decoded_data |
Encoding is not encryption
Base64, Base58 and Base32 do not protect data. Anyone can decode the value. Do not use base encoding as a security control.
Use these endpoints when data needs a transport-safe representation. Calculate the encoding locally when the input is confidential.