What is a JWT?
A JWT (JSON Web Token) is a compact, URL-safe token format used to transmit claims between systems, most commonly for authentication and API access.
JWT support
Clear explanations of how JSON Web Tokens work, what decoded claims mean, how signatures are verified, and how to use JWTs securely.
A JWT (JSON Web Token) is a compact, URL-safe token format used to transmit claims between systems, most commonly for authentication and API access.
A JWT consists of three parts: a header, a payload, and a signature. These are Base64URL-encoded and separated by dots.
Decoding a JWT reveals the header and payload contents in readable JSON format. It does not verify the signature or confirm authenticity.
No. Decoding only shows the data inside the token. Verification requires validating the signature using a secret or public key.
No. Standard JWTs are not encrypted. They are Base64URL-encoded, which is reversible and provides no confidentiality.
No. Because JWT payloads are readable, sensitive data such as passwords or personal information should never be stored inside a JWT.
Claims are key-value pairs inside the JWT payload that describe information such as user identity, permissions, issuer, and expiration time.
Registered claims are standardised fields such as iss (issuer), sub (subject), aud (audience), exp (expiration), and iat (issued at).
Yes. Applications often include custom claims, but they should be kept minimal to reduce token size and exposure.
The exp claim defines the time after which the JWT should no longer be accepted. Tokens should always be checked for expiry.
Once expired, a JWT should be rejected. Applications typically issue a new token using a refresh token or re-authentication.
JWTs are signed using cryptographic algorithms such as HS256 (shared secret) or RS256 (public/private key pair) to ensure integrity.
HS256 uses a shared secret for signing and verification, while RS256 uses asymmetric keys, allowing verification without exposing the signing key.
JWTs are secure only when properly implemented. Incorrect validation, weak secrets, or accepting unsigned tokens can lead to serious vulnerabilities.
JWTs cannot be revoked easily once issued. Revocation usually requires short expiration times or server-side token tracking.
JWTs should be stored securely, typically in HTTP-only cookies or secure storage mechanisms, to reduce exposure to XSS attacks.
Common mistakes include trusting decoded tokens without verification, using weak secrets, storing sensitive data, and setting long expiration times.
JWTs are stateless and self-contained, while traditional sessions rely on server-side storage and session identifiers.
JWTs are best suited for stateless authentication, API access, and distributed systems where server-side session storage is impractical.
Decoding does not modify the token or contact external systems, but JWT contents may expose user data if shared improperly.
No. JWT decoding is performed live. No tokens, payloads, or results are stored or logged.
Want to try it yourself? Use the JWT decoder or Understand Base64 encoding
Ready to decode a JWT?