Common questions about JWT structure, algorithms, expiry, encryption, and best practices for secure token implementation
What is a JWT (JSON Web Token)?
A JSON Web Token (JWT) is a compact, URL-safe token format defined in RFC 7519 used to represent claims securely between two parties. It consists of three Base64URL-encoded parts separated by dots: a header (algorithm and token type), a payload (the claims. User ID, roles, expiry, etc.), and a signature that verifies the token hasn't been tampered with. JWTs are widely used for authentication and authorisation in REST APIs, OAuth 2.0 flows, and single sign-on systems.
Can I use this tool to verify JWT signatures?
This tool decodes and inspects the header and payload of any JWT. It does not verify the cryptographic signature. Signature verification requires the secret (for HMAC algorithms like HS256) or the public key (for RSA/ECDSA algorithms like RS256, ES256), which should never be entered into a third-party tool. Use this tool to inspect claims, check expiry, and audit the token structure. Signature verification must be done server-side in your application using your secret or public key.
What are the most important JWT claims to check?
The most critical claims to validate on the server are: exp (expiry, reject tokens past this Unix timestamp), nbf (not-before, reject tokens before this time), iss (issuer, verify the token came from your expected auth server), aud (audience, verify the token is intended for your API), and sub (subject, the user identity). Missing or incorrect validation of these claims is a common source of JWT security vulnerabilities. This tool highlights missing claims as warnings so you can audit tokens before deployment.
What is the difference between HS256 and RS256?
HS256 (HMAC-SHA256) is a symmetric algorithm. Both the token issuer and the verifier use the same secret key. This is simpler but means every service that needs to verify tokens must share the secret, increasing the risk of key exposure. RS256 (RSA-SHA256) is an asymmetric algorithm. The issuer signs with a private key and verifiers use the corresponding public key. This is more secure for distributed systems because the public key can be shared freely without compromising signing capability. For microservices and OAuth 2.0, RS256 or ES256 are strongly preferred.
What does 'algorithm: none' mean in a JWT?
The 'none' algorithm means the JWT has no signature. The token is entirely unsigned and can be trivially forged by anyone. This is flagged as a critical security issue by this tool. Some JWT libraries historically accepted 'none' as a valid algorithm if not explicitly configured to reject it, leading to authentication bypasses in real systems. Always configure your JWT library to explicitly whitelist only the algorithms your system uses (e.g. only HS256, only RS256) and never accept 'none'.
Are JWTs encrypted?
Standard JWTs (JWS. JSON Web Signature) are signed but NOT encrypted. The header and payload are only Base64URL-encoded. Anyone who intercepts the token can decode and read its contents. Never put sensitive data (passwords, credit card numbers, SSNs) in a standard JWT payload. If you need encrypted tokens, use JWE (JSON Web Encryption), a separate standard that encrypts the payload. For most authentication use cases, non-sensitive identifiers (user ID, roles, email) in a signed JWT are appropriate as long as the transport layer uses HTTPS.
How long should a JWT be valid?
Short-lived tokens are a security best practice. Access tokens should typically expire in 15 minutes to 1 hour. Long enough to be practically useful, short enough to limit damage if intercepted. Refresh tokens can be longer-lived (days to weeks) but should be stored securely (httpOnly cookies, secure storage) and rotated on each use. Tokens with no expiry (missing exp claim) are flagged as an issue by this tool. They remain valid indefinitely even if the user logs out or changes their password, which is a significant security risk.
Can I decode a JWT without the secret?
Yes. Anyone with access to a JWT can decode the header and payload without knowing the secret or private key, because they are only Base64URL-encoded, not encrypted. This is by design: the payload is meant to be readable. The signature ensures the token hasn't been tampered with, but reading the contents requires no key. This is why you must never put sensitive data in the payload of a standard JWT. This tool decodes the header and payload instantly without any key. The signature is displayed as-is but not cryptographically verified.