Call the free base64url encode API endpoint
curl -X POST https://aisenseapi.com/services/v1/base64url_encode \
-H "Content-Type: application/json" \
-d '{"data": "hello?"}'{"base64url_encoded_data":"aGVsbG8_"}Plain Base64 writes the same bytes as aGVsbG8/. To go back, use the base64url decode API endpoint.
What differs from Base64
| Base64 | base64url | |
|---|---|---|
| Character 62 | + | - |
| Character 63 | / | _ |
| Padding | = to a multiple of four | none |
| Safe in a URL path or query | no, + and / and = need escaping | yes |
Everything else is the same, so the two decode to the same bytes once the two characters are swapped back.
Sending the input
Send the data as {"data": "..."} with Content-Type: application/json, or as the raw request body with any other content type. The raw body takes binary data as it is: curl --data-binary @file.bin -H "Content-Type: application/octet-stream".
Errors
| Status | error | When |
|---|---|---|
| 400 | No data to encode. | No data string and no body |
| 413 | Data over 1 MiB. | More than 1 MiB in one request |
Each refusal also carries fix, a sentence saying what to send instead.
Common uses
JWT parts
The header and payload of a JWT are base64url JSON. Build or inspect one part at a time.
IDs in URLs
Put a binary ID, a hash or a token into a path segment or a query value without escaping anything.
File names
base64url has no slash, so an encoded value can be a file name on any system.
Privacy and limits
Nothing is stored. The base64url encode answer is worked out while the request is open and the data is gone with it. The access log records the path and the status, not the body.
The base URL is https://aisenseapi.com/services/v1. There is no key, no account and no sign-up step. One request carries at most 1 MiB of data, and the service-wide limit is 5000 requests per IP address per day. Every endpoint in the collection is listed on the Free public REST APIs reference, and the encodings side by side on Encoding APIs.