Free Online JWT Decoder & Encoder

Decode JWT tokens and inspect header, payload, and signature. Check token expiration, validate claims, and encode new tokens with HS256.

JWT Structure:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0In0.dQvJq...
Header Payload Signature
key JWT Token
code Decoded Token

Key Features

search

Full Token Inspection

Decode and view header, payload, and signature separately with color coding.

schedule

Expiration Check

Automatic validation of token expiration and issuance time with visual indicators.

build

JWT Encoder

Create and sign JWT tokens with multiple algorithms (HS256, HS384, HS512).

lock

Privacy Protected

Your data never leaves your browser. No server storage or tracking.

Frequently Asked Questions

Getting Started
What is a JWT token?expand_more
JWT (JSON Web Token) is an open standard (RFC 7519) for securely transmitting information between parties as a JSON object. It's commonly used for authentication and information exchange. A JWT consists of three parts: Header, Payload, and Signature, separated by dots.
Is this JWT decoder safe?expand_more
Yes, completely safe. This JWT decoder runs entirely in your browser using client-side JavaScript. Your tokens never leave your device or get uploaded to any server, ensuring complete privacy and security.
How do I decode a JWT?expand_more
Simply paste your complete JWT token string into the input area and click the "Decode" button (or enable realtime mode for automatic decoding). The decoder will parse the token and display each part with syntax-highlighted JSON formatting.
Understanding JWT Structure
What is the JWT header?expand_more
The JWT header is a JSON object that contains metadata about the token. It typically includes two fields: "alg" (the signing algorithm such as HS256, RS256, or ES256) and "typ" (the token type, usually "JWT"). The header is Base64Url encoded to form the first part of the JWT.
What is the JWT payload?expand_more
The JWT payload contains the claims — statements about an entity (typically the user) and additional data. Common claims include: sub (subject), iat (issued at), exp (expiration), iss (issuer), aud (audience), and nbf (not before).
What is the JWT signature?expand_more
The JWT signature is used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed. It's created by signing the encoded header and payload with a secret key using the algorithm specified in the header.
Token Validation & Claims
How do I know if my token is expired?expand_more
This decoder automatically reads the "exp" (expiration time) and "nbf" (not before) claims from the payload and compares them with the current system time. Valid tokens are highlighted in green with remaining validity time displayed.
Can I generate JWTs with this tool?expand_more
Yes! Switch to the "Encode" tab to create and sign JWT tokens. You can customize the header and payload JSON, select from multiple signing algorithms (HS256, HS384, HS512, or none), enter your secret key, and optionally add standard claims.
JWT Claims Reference
View Common JWT Claims Tableexpand_more
Claim Full Name Description Example
expExpiration TimeToken expiration timestamp1735689600
iatIssued AtToken creation timestamp1704153600
nbfNot BeforeToken becomes valid1704153600
subSubjectUser identifieruser123
audAudienceIntended recipientapi.example.com
issIssuerToken creatorauth.example.com
jtiJWT IDUnique identifier4f1g2a3b
How do I verify a JWT signature?expand_more
This tool decodes the header and payload of any JWT without needing the secret. However, signature verification requires the secret key. For HMAC-signed tokens (HS256/HS384/HS512), use the verification tool with your secret:

const jwt = require("jsonwebtoken");\nconst decoded = jwt.verify(token, "your-secret");\nconsole.log(decoded); // { sub: "123", name: "John" }

For RS256/ES256 (asymmetric algorithms), you need the public key. Note that signature verification is displayed when you provide the key, while header/payload decoding works without any key.
What is the difference between JWT and JWS (JSON Web Signature)?expand_more
JWT and JWS are closely related but not identical. JWS (RFC 7515) is a mechanism for signing arbitrary content, producing a compact serialization of header + payload + signature. JWT (RFC 7519) is a specific use case of JWS that requires the payload to be a JSON claims set with registered claim names like exp and sub. Every JWT is technically a JWS, but not every JWS is a JWT — JWS can sign any binary payload. The JWT specification adds constraints on what the payload must contain.
How do I securely store JWT tokens on the client side?expand_more
For web applications, store JWTs in an httpOnly secure SameSite cookie rather than localStorage or sessionStorage. Cookies with the httpOnly flag cannot be accessed by JavaScript, preventing XSS attacks from stealing the token. localStorage is accessible via any JavaScript executing on the same origin, making it vulnerable to XSS. The trade-off is that cookie-based storage requires CSRF protection, while localStorage-based storage requires careful XSS prevention. For mobile apps, use the platform-native secure key storage (Keychain on iOS, Keystore on Android).
What happens if a JWT token's exp claim is missing?expand_more
If a JWT has no exp (expiration) claim, the token never expires according to the JWT specification. Most security-conscious applications should reject tokens without an expiration time during validation. The exp claim is a registered claim (recommended but not mandatory per RFC 7519), meaning servers must explicitly check for it. Security frameworks like Spring Security and Auth0's JWT libraries often enforce exp by default. Always include an exp claim in tokens you generate and validate it on the server side.
How does RS256 (asymmetric signing) differ from HS256 (symmetric signing)?expand_more
HS256 uses a single shared secret key for both signing and verification — anyone with the secret can both create and verify tokens. RS256 uses a private key to sign and a public key to verify, enabling third-party verification without exposing signing capability. RS256 is preferred for microservice architectures where the auth service signs tokens and other services only need the public key to verify them. HS256 is simpler but requires the secret to be shared with every service that needs to verify tokens, increasing the risk of secret exposure.

For more information, see the JWT specification (RFC 7519), the jwt.io introduction to JSON Web Tokens, and OWASP's JWT Security Best Practices.

Last updated: July 14, 2026