Developer
Jun 30, 2026
JWT Uses Base64url but Basic Auth Uses Standard Base64 — Why the Encoding Choice Matters in Security Contexts
JWTs use Base64url (not standard Base64) because they appear in URLs and HTTP headers where + and / would break things. HTTP Basic Auth uses standard Base64 (not Base64url) because it's an opaque header value. Here's the three security contexts for Base64 encoding (JWT, Basic Auth, CSP nonces/hashes), why JWT payloads are encoded not encrypted (anyone with the token can read the claims), and how to detect standard Base64 vs Base64url from the encoded string.