Anatomy of a JWT
A JSON Web Token is three Base64URL strings joined by dots: header.payload.signature. The header names the signing algorithm (alg), the type (typ) and often a key ID (kid) that tells the receiver which key to fetch from a JWKS endpoint. The payload carries claims: registered ones such as iss (issuer), sub (subject), aud (audience), exp (expiry), nbf (not before), iat (issued at) and jti (token ID), plus whatever the identity provider adds, like scp, roles or tid. The signature covers the first two segments.
The header and payload are encoded, not encrypted. Anyone holding the token can read them, which is exactly what this decoder does. Encrypted tokens (JWE) have five segments instead of three; for those only the protected header can be shown, because the payload needs the recipient’s private key.
Reading a token
Paste the token into the input pane. Surrounding quotes, a Bearer prefix and even a full Authorization: Bearer ... header line are stripped before decoding, so you can copy straight from browser dev tools or a log line. The output is a single JSON document with header, payload and signature keys, indented with the toolbar’s Indent setting; switch to the Tree view to fold large payloads.
The info panel interprets what the raw JSON does not say plainly. Algorithm gets a name (HS256 is “HMAC with SHA-256”, RS256 is “RSA PKCS#1 v1.5 with SHA-256”), iat, nbf and exp become UTC timestamps with a relative note such as “expires in 3 hours”, and Status reads Valid, Expired, Not yet valid or Valid (no expiry). The Signature row says Not verified until you supply a key. Copy the decoded JSON with Ctrl/Cmd+Shift+C.
Debugging a rejected token
When an API refuses a token, compare the decoded claims against what that API is configured to accept, in this order:
expandnbf. Check the Status row first. Libraries such as jsonwebtoken reportjwt expired, and the fix is a new token.aud. A token issued for one API is not valid for another. A classic Microsoft Entra case: sending a Microsoft Graph token to your own API surfaces as a signature validation failure, because only Graph can validate it. Ifaudishttps://graph.microsoft.comor00000003-0000-0000-c000-000000000000, request the token with your API’s scope.iss. Staging and production usually differ here, as do multi-tenant apps, where the issuer contains the tenant ID.kidandalg.IDX10501: Signature validation failed. Unable to match 'kid'from .NET means the API’s key set has no entry for thatkid, often a stale cache after key rotation or the wrong metadata endpoint.
The JWT errors guide walks through each failure with library-specific messages.
Checking the signature
Decoding never needs a key. To go further, fill in Verify with secret or public key (optional). It accepts three kinds of key:
- An HMAC secret for HS256, HS384 and HS512 tokens, typed exactly as the issuing service stores it.
- A PEM public key or certificate (
-----BEGIN PUBLIC KEY-----) for RS, PS, ES and EdDSA algorithms. - A JWK as JSON, for example one entry copied from an identity provider’s
/.well-known/jwks.json.
The check is done by jose, and the result appears both as a diagnostic and in the Signature row: Verified, or Invalid with the reason. A key whose type does not fit the header’s alg is reported as a mismatch rather than a bad signature, and a private key is refused with a request for the public half. Tokens and keys are processed locally in the page and are not sent anywhere.
Warnings it raises
An exp in the past produces a warning with the exact expiry time; a future nbf says when the token becomes usable; an iat ahead of the current time points at clock skew on the issuer. If exp or iat looks like milliseconds instead of seconds, you are told to divide by 1000, a common bug in hand-rolled token code. A header with "alg": "none" is called out as unsecured, since anyone can forge such a token, and an empty signature segment is reported too.
A token decoding cleanly proves nothing about who issued it. Your API must verify the signature and check exp, aud and iss on every request, and nothing confidential belongs in a payload that any client can read.
Examples
Microsoft Entra access token from an Authorization header
The header prefix is stripped and the v2.0 claims appear with no key supplied: the aud to compare with your API, tid in the issuer, and the scp scopes. The IDs are made up.
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlhrM3BROXNUMXZZd1owYUJjRDJlRjRnSDZqSSJ9.eyJhdWQiOiI2ZjFjOWE0Mi0zZDdlLTRiMTgtOWM1NS0yYThlMWY3MGIzZDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vMGI3ZDRlMjEtOGEzZi00Yzk2LWIxZTQtNWQyZjlhYzA2ZTczL3YyLjAiLCJpYXQiOjE3ODk0NzUyMDAsIm5iZiI6MTc4OTQ3NTIwMCwiZXhwIjo0MTAyNDQ0ODAwLCJhenAiOiJjMmE3ZTgxNS05NGJkLTRmMDMtYTZkMS03ZTNiMGM5ZjE4NDIiLCJhenBhY3IiOiIwIiwibmFtZSI6IkFpc2hhIFRhbiIsIm9pZCI6IjNlOWQ2YjcwLTFjMjQtNGE4Zi04ZTUzLWIwN2YyZDQxYzk2YSIsInByZWZlcnJlZF91c2VybmFtZSI6ImFpc2hhLnRhbkBleGFtcGxlLmNvbSIsInNjcCI6Ik9yZGVycy5SZWFkIE9yZGVycy5Xcml0ZSIsInN1YiI6Im1RNHZUOGtOMnpSN3hMcDBjV3k1aEo5c0ZiRDNnRTF1QW9LaVZuNnRZcU0iLCJ0aWQiOiIwYjdkNGUyMS04YTNmLTRjOTYtYjFlNC01ZDJmOWFjMDZlNzMiLCJ2ZXIiOiIyLjAifQ.iL9tWbn-WNJD6q71CAR3Ma_n92nWz1go13P_wEhAz4xqLI24haTftw0wIx4Uip20QkEcbpbTCv3eyvRxdiOkCtJMVUU7p_Y8z1v8MxqzzHbgg5Q6MaKuur8okTd25cKpGumWzQQHW7t2kGNu521YHYK0TM_5o963RZbBdYOPiZYKndNeAzmJZJJLRifkv3GPCkkRvLjgcVUxwEyPEub7WU461ZTe1CS93VTW8yPzBjW7c6Im5t5h5A4AQik8tQsm_0g9jUWr2rjchNePryClPuKVU3rZXpGGHoqjd2gHOQOc9XJmuHaEHAuxNNqWn51qZBCrWNE19UwoKFT8XdE0Zw{
"header": {
"typ": "JWT",
"alg": "RS256",
"kid": "Xk3pQ9sT1vYwZ0aBcD2eF4gH6jI"
},
"payload": {
"aud": "6f1c9a42-3d7e-4b18-9c55-2a8e1f70b3d6",
"iss": "https://login.microsoftonline.com/0b7d4e21-8a3f-4c96-b1e4-5d2f9ac06e73/v2.0",
"iat": 1789475200,
"nbf": 1789475200,
"exp": 4102444800,
"azp": "c2a7e815-94bd-4f03-a6d1-7e3b0c9f1842",
"azpacr": "0",
"name": "Aisha Tan",
"oid": "3e9d6b70-1c24-4a8f-8e53-b07f2d41c96a",
"preferred_username": "[email protected]",
"scp": "Orders.Read Orders.Write",
"sub": "mQ4vT8kN2zR7xLp0cWy5hJ9sFbD3gE1uAoKiVn6tYqM",
"tid": "0b7d4e21-8a3f-4c96-b1e4-5d2f9ac06e73",
"ver": "2.0"
},
"signature": "iL9tWbn-WNJD6q71CAR3Ma_n92nWz1go13P_wEhAz4xqLI24haTftw0wIx4Uip20QkEcbpbTCv3eyvRxdiOkCtJMVUU7p_Y8z1v8MxqzzHbgg5Q6MaKuur8okTd25cKpGumWzQQHW7t2kGNu521YHYK0TM_5o963RZbBdYOPiZYKndNeAzmJZJJLRifkv3GPCkkRvLjgcVUxwEyPEub7WU461ZTe1CS93VTW8yPzBjW7c6Im5t5h5A4AQik8tQsm_0g9jUWr2rjchNePryClPuKVU3rZXpGGHoqjd2gHOQOc9XJmuHaEHAuxNNqWn51qZBCrWNE19UwoKFT8XdE0Zw"
}
Staging session token verified with its secret
With the HMAC secret in the verify field, the Signature row changes from Not verified to Verified. Try a different secret to see the mismatch message.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfNDIiLCJlbWFpbCI6ImFpc2hhLnRhbkBleGFtcGxlLmNvbSIsInJvbGUiOiJiaWxsaW5nX2FkbWluIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLnN0YWdpbmcuZXhhbXBsZS5jb20iLCJhdWQiOiJiaWxsaW5nLWFwaSIsImlhdCI6MTc4OTQ3NTIwMCwiZXhwIjo0MTAyNDQ0ODAwfQ.e3A6ly5miM_48wkrR9mc3Qh_VxmK-csIDA6O9GdmyAg{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "usr_42",
"email": "[email protected]",
"role": "billing_admin",
"iss": "https://auth.staging.example.com",
"aud": "billing-api",
"iat": 1789475200,
"exp": 4102444800
},
"signature": "e3A6ly5miM_48wkrR9mc3Qh_VxmK-csIDA6O9GdmyAg"
}
Timestamps issued in milliseconds
A bug from using Date.now() directly: warnings flag both iat and exp as milliseconds, and iat also reads as issued in the future.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzdmNfcmVwb3J0cyIsImlhdCI6MTc4OTQ3NTIwMDAwMCwiZXhwIjoxNzg5NDc4ODAwMDAwLCJzY29wZSI6InJlcG9ydHM6cmVhZCJ9.a-LdHVNR4b_Ihpt-6GkmWTvQWklL9kfgeRl0w-BFrjo{
"header": {
"alg": "HS256",
"typ": "JWT"
},
"payload": {
"sub": "svc_reports",
"iat": 1789475200000,
"exp": 1789478800000,
"scope": "reports:read"
},
"signature": "a-LdHVNR4b_Ihpt-6GkmWTvQWklL9kfgeRl0w-BFrjo"
}
Unsigned token with alg none
The payload still decodes, but a warning explains that a token with no signature can be forged by anyone, which matters when it claims an admin role.
eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJ1c3JfNDIiLCJyb2xlIjoiYWRtaW4iLCJleHAiOjQxMDI0NDQ4MDB9.{
"header": {
"alg": "none",
"typ": "JWT"
},
"payload": {
"sub": "usr_42",
"role": "admin",
"exp": 4102444800
},
"signature": ""
}
Common errors and how to fix them
| Error | Cause | Fix |
|---|---|---|
The token expired 2 weeks ago (2026-09-15T13:26:40Z)Explained | The exp claim is earlier than the current time. This is a warning: the token still decodes, but a server would reject it, for example with jwt expired from jsonwebtoken. | Request a fresh token, or use the refresh token flow. If it expired seconds after issue, check that exp was written in seconds. |
Signature does not match the supplied keyExplained | The secret or public key in the verify field is not the one that signed the token, or the header or payload was edited after signing. | Check you copied the right secret for the environment, or the JWK whose kid matches the header. Any change to the token invalidates its signature. |
Key type does not fit alg RS256: a plain secret only verifies HS256/HS384/HS512 tokens; supply a PEM public key or JWK | The header says the token is signed with an RSA key, but the verify field holds a shared secret. The reverse case is reported the same way. | Use the key type the alg calls for. For RS256 that means the public key or JWK from the issuer, usually from its JWKS endpoint. |
A JWT has 3 dot-separated segments (header.payload.signature), or 5 for an encrypted JWE; this has 1 | The value is an opaque access token, or a JWT cut off at a line wrap. Auth0, for example, returns an opaque token when the audience parameter is left out of the authorize request. | Ask for a token with your API as the audience, or copy the whole value again. Opaque tokens can only be inspected through the issuer. |
PKCS#1 "RSA PUBLIC KEY" PEMs are not supported | The key begins with BEGIN RSA PUBLIC KEY. Verification needs the SPKI form, which begins with BEGIN PUBLIC KEY. | Convert it with openssl rsa -RSAPublicKey_in -pubout, then paste the result. |
Segment 3 (signature) contains '+', which is not valid Base64URL | The token was re-encoded with the standard Base64 alphabet, or a + was introduced by URL decoding. | JWTs use - instead of +, _ instead of / and no = padding. Copy the token from its original source rather than from a decoded URL. |
Frequently asked questions
Can I decode a JWT without the secret key?
Yes. The header and payload are only Base64URL-encoded, so they can always be read. The key is needed only to prove the token was signed by the issuer and has not been changed.
Is it safe to paste a production token here?
Decoding and verification run in your browser and the token is not uploaded. A live token is still a credential, so avoid putting it in shared links, screenshots or tickets.
How do I verify an RS256 or ES256 token?
Paste the issuer’s public key as PEM, or one JWK from its JWKS endpoint, into the verify field. Pick the JWK whose kid matches the kid in the token header.
Why are the iat and exp values such large numbers?
JWT times are NumericDate values: seconds since 1 January 1970 UTC. The info panel converts them to readable dates, and the Unix timestamp converter does the same for any other epoch value.
Why does my API say the signature is invalid when the token decodes fine?
Decoding does not involve the signature at all. Check that aud names your API and that kid exists in the key set your API loads; a token meant for a different service is the usual cause.
Can this tool decrypt an encrypted JWE?
No. A five-segment JWE is recognised and its protected header is shown, but the payload can only be decrypted with the recipient’s private key.