Transform - Encoding

Free base64url Encode API Endpoint

The free base64url encode API endpoint writes text or bytes in base64url, the URL-safe alphabet of RFC 4648 with - and _ in place of + and /, and no = padding. It is the form JWT, OAuth PKCE and WebAuthn use, and it goes into a URL or a file name as it is.

  • No API key
  • URL safe
  • No padding
  • Binary safe

Encode to base64url

POST/base64url_encode

https://aisenseapi.com/services/v1/base64url_encode

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

Base64base64url
Character 62+-
Character 63/_
Padding= to a multiple of fournone
Safe in a URL path or queryno, + and / and = need escapingyes

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

StatuserrorWhen
400No data to encode.No data string and no body
413Data 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.