Base64 Encode
POST
/v1/convert/base64-encode
curl -X POST "https://convert.toolkitapi.io/v1/convert/base64-encode" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "Hello, World!"}'
# See curl example
// See curl example
Response
200 OK
{
"output": "SGVsbG8sIFdvcmxkIQ==",
"input_size": 13,
"output_size": 20
}
How to Use
1
Send a POST request to /v1/convert/base64-encode with an input string.
About This Tool
Encode a plain text string to Base64 (RFC 4648). Supports standard and URL-safe alphabets.
Input is UTF-8 encoded before Base64 encoding. The response includes both the encoded string and its byte length.
Why Use This Tool
- Data Embedding — Encode binary data or text for embedding in JSON payloads, data URIs, or email attachments.
- Token Generation — Encode credentials or tokens for HTTP Basic Authentication headers.
Frequently Asked Questions
Is URL-safe encoding available?
Yes — pass 'url_safe': true to use the URL-safe Base64 alphabet (- and _ instead of + and /).
What about binary data?
Send binary data as a Base64 string in the input field — the API will re-encode it.
Start using Base64 Encode now
Get your free API key and make your first request in under a minute.