JWT Decoder

JWT Decoder & Debugger

Decode, inspect and verify JWT tokens — fast, private, no server upload.

Header

Payload

Signature

JWT Example Payloads

Click any example below to load it into the decoder and see how different JWT tokens are structured. Each example demonstrates a specific use case or security scenario.

ExampleDescriptionKey ClaimsTry
Basic AuthenticationStandard user login token with common claimssub, name, email, exp
Expired TokenToken with past expiration — triggers expired warningexp in the past
alg:none (Insecure)No signature algorithm — critical security riskalg: "none"
No ExpirationService account token without exp — never expiresno exp, has scope
Admin with RolesRBAC token with role and permissions arrayrole, permissions[]
OAuth2 / OpenID ConnectGoogle-style OIDC token with OAuth2 claimsazp, nonce, email_verified
Long-Lived TokenIoT device token with 5-year expiry — triggers long-exp warningexp 5 years out
Minimal TokenSmallest valid JWT with only required claimssub, iat only

All example tokens are signed with HS256. Enter secret key toolmodoom in the Verify Signature section to test signature verification.

What is a JWT?

A JSON Web Token (JWT) is a compact, URL-safe token format defined in RFC 7519. JWTs are widely used for authentication and authorization in web applications, APIs, and microservices. When you log in to a website, the server often issues a JWT that your browser sends with every subsequent request to prove your identity.

Unlike traditional session-based authentication that requires server-side storage, JWTs are self-contained — all the information needed to verify the token is encoded within the token itself. This makes them ideal for stateless architectures and distributed systems.

JWT Structure (Header, Payload, Signature)

A JWT consists of three parts separated by dots (.):

  1. Header — Contains the token type (typ: JWT) and the signing algorithm (alg: HS256, RS256, etc.).
  2. Payload — Contains claims (statements about the user and metadata). Claims include registered claims like exp (expiration), iss (issuer), and sub (subject), plus any custom data.
  3. Signature — Created by signing the encoded header and payload with a secret key (HS256) or a private key (RS256/ES256). The signature ensures the token hasn't been tampered with.

Each part is Base64URL-encoded, making the token URL-safe and compact enough to be sent in HTTP headers, cookies, or URL parameters.

JWT Algorithm Comparison

JWTs support multiple signing algorithms. Choosing the right one depends on your architecture, security requirements, and key management capabilities.

AlgorithmTypeKeyUse CaseSecurity
HS256HMAC + SHA-256Shared secretSingle server, internal APIsGood — requires secret sharing
RS256RSA + SHA-256Private/Public key pairDistributed systems, microservices, OAuth2Strong — public key can be shared safely
ES256ECDSA + P-256Private/Public key pairMobile apps, IoT, performance-sensitiveStrong — smaller keys, faster than RSA
PS256RSASSA-PSS + SHA-256Private/Public key pairHigh-security environmentsStrongest RSA variant — probabilistic padding
HS384/512HMAC + SHA-384/512Shared secretWhen 256-bit hash is insufficientGood — larger hash output
RS384/512RSA + SHA-384/512Private/Public key pairCompliance requirements (FIPS, etc.)Strong — larger hash output
noneNo signatureNoneDO NOT USE in productionNone — tokens can be forged

Recommendation: Use RS256 or ES256 for production systems. Use HS256 only when the signing and verification happen on the same server. Never use none in production.

Common JWT Claims

The JWT specification defines seven registered claims:

ClaimNameDescription
issIssuerWho issued the token
subSubjectWho the token is about (usually user ID)
audAudienceIntended recipient of the token
expExpirationUnix timestamp when the token expires
nbfNot BeforeToken is not valid before this time
iatIssued AtWhen the token was created
jtiJWT IDUnique identifier for the token

💡 Need to generate a unique jti value? Use the UUID GeneratorUUID v4 (random) is the recommended choice for JWT IDs, providing collision-free uniqueness without leaking creation time.

Common Public Claims (OAuth2 / OpenID Connect)

In addition to registered claims, these public claims are widely used in OAuth2 and OIDC tokens:

ClaimNameDescription
nameFull NameUser's display name
emailEmailUser's email address
email_verifiedEmail VerifiedWhether the email has been verified (boolean)
rolesRolesUser roles for RBAC (e.g., "admin", "editor")
scopeScopeOAuth2 granted permissions (e.g., "read write")
azpAuthorized PartyClient ID of the application that requested the token
nonceNonceRandom value for replay attack protection (OpenID Connect)

JWT vs Session/Cookie

When building authentication, developers often choose between JWT-based and session-based approaches. Each has distinct trade-offs depending on your architecture:

AspectJWTSession/Cookie
StateStateless — token contains all infoStateful — server stores session data
ScalabilityEasy horizontal scaling (no shared store)Requires shared session store (Redis, DB)
SizeToken can be large (all claims included)Cookie is small (session ID only)
RevocationDifficult (requires blacklist or short expiry)Easy (delete from server)
Security riskToken theft (XSS if stored in localStorage)CSRF attacks (mitigated by SameSite cookies)
Best forAPIs, microservices, mobile apps, SSOTraditional web apps, server-rendered pages

Neither approach is universally better. JWTs excel in distributed, stateless architectures where multiple services need to verify identity without a central session store. Sessions are simpler and more secure for traditional server-rendered applications where immediate revocation matters.

Common JWT Errors and How to Fix Them

When working with JWTs, you may encounter these common error messages. Paste your token into the tool above to inspect the Header and Payload for debugging.

TokenExpiredError: jwt expired

Cause: The exp claim timestamp has passed. The token is no longer valid.

Fix: Request a new token from the authentication server. If you control the server, consider extending the token lifetime or implementing a refresh token flow. Use this tool to check the exact expiration time.

JsonWebTokenError: jwt malformed

Cause: The token string is not a valid JWT format. This usually happens when the token is truncated, corrupted, or not Base64URL-encoded properly.

Fix: Ensure you are copying the complete token string without extra whitespace or line breaks. Check that no URL encoding has been applied to the dots (.) separating the three parts.

JsonWebTokenError: invalid signature

Cause: The signature does not match the Header and Payload. This means the token was either tampered with or signed with a different key than expected.

Fix: Verify that your server is using the correct signing key. If you recently rotated keys, ensure the verification side has the updated public key. Use the Verify Signature feature above to test with your key.

Error: JWT must have 3 parts

Cause: The input does not contain exactly three dot-separated segments (header.payload.signature).

Fix: Make sure you are pasting the complete JWT token. A valid JWT always has exactly two dots. If your token starts with Bearer , remove that prefix before pasting.

JWT Security Best Practices

  • Always set an expiration time (exp) — tokens without expiration never become invalid.
  • Never use alg: "none" — this disables signature verification, allowing anyone to forge tokens.
  • Don't store sensitive data in the payload — JWTs are encoded, not encrypted. Anyone can decode the payload.
  • Use strong signing algorithms — prefer RS256 or ES256 over HS256 for production systems.
  • Keep token lifetimes short — use refresh tokens for long-lived sessions.
  • Validate the iss and aud claims — ensure the token was issued by and intended for your application.

JWT in Different Frameworks

Here are the most popular JWT libraries for each programming language, along with their install commands:

LanguageLibraryInstall Command
Node.jsjsonwebtokennpm install jsonwebtoken
PythonPyJWTpip install pyjwt
Javajjwt (io.jsonwebtoken)Maven/Gradle dependency
Gogolang-jwt/jwtgo get github.com/golang-jwt/jwt/v5
.NET / C#System.IdentityModel.Tokens.Jwtdotnet add package Microsoft.IdentityModel.Tokens
PHPfirebase/php-jwtcomposer require firebase/php-jwt
Rubyruby-jwtgem install jwt

All of these libraries support token creation, signing, verification, and claim validation. For decoding without verification (inspecting token contents), most also provide a decode method that skips signature checking — similar to what this tool does in your browser.

How to Use This Tool

  1. Paste your JWT token into the input field above, or click Paste Sample to try a demo token.
  2. The tool instantly decodes the Header and Payload with syntax highlighting.
  3. Time-based claims (exp, iat, nbf) are automatically converted to human-readable dates in your selected timezone.
  4. Security warnings appear if potential issues are detected (e.g., alg: none, missing expiration, sensitive data in claims).
  5. Click → JSON Formatter to open the decoded payload in our JSON Formatter tool for further inspection.
  6. Optionally, enter your secret key and click Verify Signature to check if the signature is valid.

Features

Instant Decode

Paste any JWT and instantly see the Header and Payload as formatted, syntax-highlighted JSON. Decoding happens in real time as you type — no button clicks needed.

Expiration Visualization

Time-based claims (exp, iat, nbf) are automatically converted to human-readable dates in your selected timezone, with relative time display and expiration status.

Security Warnings

Automatically detects dangerous patterns: alg:none tokens, missing expiration, excessively long token lifetime, and sensitive data in claims. Warnings are color-coded by severity.

Signature Verification

Verify HS256 token signatures directly in your browser using the Web Crypto API. Enter your secret key and confirm if the signature is valid — no server upload required.

Claim Explanations

Registered claims (iss, sub, aud, exp, nbf, iat, jti) are automatically annotated with descriptions. Custom claims are labeled separately.

100% Private

All processing happens in your browser using JavaScript. No token data is ever sent to any server. Safe to use with production tokens, API keys, and sensitive credentials.

Privacy & Security

Your JWT token is processed entirely in your browser using JavaScript. Nothing is sent to any server. All decoding, claim analysis, security checks, and signature verification happen locally. You can verify this by opening your browser's developer tools and checking the Network tab — no requests are made with your token data. This tool is safe to use with production tokens and sensitive credentials.