JWT Builder & Decoder
Construct JWT payloads with standard claims and custom fields, or decode an existing token. No secrets required — 100% client-side.
Standard JWT Claims (RFC 7519)
| Claim | Name | Type | Description |
|---|---|---|---|
iss | Issuer | String (URI) | Identifies the principal that issued the token. Usually the auth server URL. |
sub | Subject | String | Identifies the principal that is the subject of the token. Typically a user ID. |
aud | Audience | String or Array | Identifies the recipients for which the token is intended. |
exp | Expiration Time | NumericDate | Unix timestamp after which the token MUST NOT be accepted. |
nbf | Not Before | NumericDate | Unix timestamp before which the token MUST NOT be accepted. |
iat | Issued At | NumericDate | Unix timestamp when the token was issued. |
jti | JWT ID | String | Unique identifier for the token. Prevents replay attacks. |
Common Algorithms
| Algorithm | Type | Key Size | Notes |
|---|---|---|---|
| HS256 | HMAC-SHA256 | 256-bit secret | Most common. Symmetric — same key signs and verifies. |
| HS512 | HMAC-SHA512 | 512-bit secret | Stronger HMAC variant. Symmetric. |
| RS256 | RSA-SHA256 | 2048+ bit RSA | Asymmetric. Private key signs, public key verifies. |
| ES256 | ECDSA-P256-SHA256 | 256-bit EC | Smaller key than RSA with equivalent security. |
| none | Unsecured | — | No signature. Never use in production. |
How to Use the JWT Builder
- Build mode — Select the signing algorithm, fill in standard claims like
sub,exp, andiat, add any custom claims, then click Build. The tool produces an unsigned Base64URL-encoded JWT for inspection. - Decode mode — Paste any existing JWT to instantly decode and view its header and payload claims in readable JSON format.
- Reference tab — Browse the full IANA standard claims table and a guide to JWT algorithms.
What Is a JSON Web Token?
A JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. Defined in RFC 7519, a JWT has three parts separated by dots: the header (algorithm and token type, Base64URL-encoded), the payload (claims, Base64URL-encoded), and the signature (HMAC or RSA/ECDSA over the header and payload). The header and payload are not encrypted by default — they are simply encoded. Anyone who holds a JWT can decode and read its contents.
Why Use JWTs for Authentication?
JWTs are widely used in stateless authentication systems. When a user logs in, the server issues a signed JWT containing claims like the user ID and token expiry. The client stores this token (in memory or a secure cookie) and sends it with every request in the Authorization: Bearer <token> header. The server can verify the signature without consulting a database, enabling horizontally scalable microservices that share no session state. Popular frameworks like OAuth 2.0, OpenID Connect, and Auth0 all use JWTs as their token format.
Understanding the exp Claim
The exp (expiration time) claim is a Unix timestamp — the number of seconds since January 1, 1970 UTC. A token with "exp": 1711238167 expires at that specific moment. The date-time picker in this builder converts the human-readable date you select into the correct Unix timestamp automatically. Short-lived tokens (15 minutes to 1 hour) reduce the window of attack if a token is stolen. Pair short expiry with refresh tokens to maintain seamless user sessions.
Security Considerations
Never verify JWTs on the client side — always verify the signature server-side before trusting any claim. Watch out for the alg: none attack, where a malicious token sets the algorithm to none and removes the signature, tricking a vulnerable verifier into accepting it. Always explicitly specify the expected algorithm in your verifier, never trust the algorithm from the token itself. Store JWTs in HttpOnly cookies rather than localStorage to mitigate XSS attacks. For more on token security, see the Hash Generator and SSL Certificate Decoder.
Custom Claims and Namespacing
Beyond the standard IANA claims, you can add any custom claims to a JWT payload. To avoid collision with future standard claims, the JWT specification recommends namespacing custom claims using a URI prefix (e.g., https://yourapp.com/roles). Common custom claims include user roles (roles: ["admin", "editor"]), tenant identifiers, and permission scopes. Keep JWTs compact — every extra byte increases request overhead. For large amounts of data, store it server-side and reference it with a compact identifier claim in the token.