Decoding a JWT segment
Header and payload are Base64URL. Decoding a single segment inspects claims without a full JWT parser, which is useful when the token is malformed.
Encodes/decodes URL-safe Base64 — the variant used in JWTs and web APIs.
Encodes/decodes URL-safe Base64 — the variant used in JWTs and web APIs.
hello?
aGVsbG8_
The / and + characters become _ and -; padding is omitted.
Same bytes, different alphabet — compatible where standard Base64 is not URL-safe.
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/base64-url" \
-H "Content-Type: application/json" \
-d '{"input":"hello world","mode":"encode"}'const res = await fetch("https://yas.sh/api/v1/tools/base64-url", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"input": "hello world",
"mode": "encode"
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/base64-url", json={"input":"hello world","mode":"encode"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| input | string | Yes | Text |
| mode | string | No (default encode) | encode | decode |
{ "result": "aGVsbG8gd29ybGQ", "mode": "encode" }Encode/decode using URL-safe Base64 (base64url).
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).Base64URL is the URL- and filename-safe alphabet defined in RFC 4648 §5. It differs from standard Base64 in exactly three ways: + becomes -, / becomes _, and the trailing = padding is usually omitted. Those substitutions matter because + is decoded as a space in query strings, / is a path separator, and = is a key/value delimiter — a standard Base64 string dropped into a URL is corrupted by the URL parser itself.
This variant is what JWTs, OAuth 2.0 PKCE challenges, WebAuthn credential IDs and webhook signatures use. Because padding is omitted, decoders must reconstruct it: the string length modulo 4 determines how many = characters to append, and a length of exactly 1 modulo 4 is invalid and indicates truncation.
Header and payload are Base64URL. Decoding a single segment inspects claims without a full JWT parser, which is useful when the token is malformed.
The code_challenge is the Base64URL encoding of the SHA-256 of the verifier, unpadded. Getting the variant wrong produces an authorization error that names nothing useful.
Identifiers, signatures and compact tokens travel safely in path segments and filenames without further percent-encoding.
Providers commonly encode HMAC output as Base64URL. Decoding confirms whether a mismatch is a variant problem or a genuinely wrong secret.
What this tool deliberately does not do, and where it will disagree with other implementations.