Debugging 401 Token Rejections Without Leaking Bearer Credentials
Intermittent 401 Unauthorized responses in mobile and web apps often trace back to subtle claim mismatches inside a JSON Web Token — such as device clock skew pushing iat (Issued At) or nbf (Not Before) outside an API gateway's tolerance window, or missing audience (aud) scopes.
Because a live JWT is effectively a temporary session key, pasting it into a remote server-backed decoder risks token replay. Inspecting the Base64URL header and payload inside a purely client-side decoder lets you verify claims safely in local RAM.
Anatomy of a JSON Web Token (JWT)
A JWT consists of three base64url-encoded segments separated by periods (.):
- Header: Specifies the cryptographic algorithm (e.g. HS256, RS256) and token type.
- Payload (Claims): Contains user identifiers, roles, permissions, and expiration timestamps.
- Signature: Ensures the token has not been tampered with in transit.
Decode JWTs & Base64 Safely in Your Browser
Inspect headers, payloads, and claims without sending sensitive authorization tokens to third-party web servers.
Base64 vs. Base64URL: The URL-Safe Distinction
Standard Base64 uses characters +, /, and padding =, which have reserved syntactic meanings in URL query strings and HTTP headers. Base64URL replaces + with -, / with _, and omits the trailing = padding, preventing broken URL paths.
