Skip to content
OddsockLocal
Local
Source text

Formatting

1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste a three-part JWT.
  2. Leave HMAC secret empty to read header and claims only.
  3. Paste the HMAC secret to set signatureStatus to valid or invalid. This works for HS256, HS384 and HS512.
  4. Read expired and notYetValid. They are null when exp or nbf is absent.

What is JWT decoder?

A JWT is three Base64URL segments. The decoder reads the first as the header and the second as the claims, and it looks at the third only when you paste an HMAC secret. The token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhbGljZSIsIm5hbWUiOiJBZGEifQ.Nqb6ie-8gcMIXEPIIKNgKXLK5E11SoIbasJHr4o0J3g with secret some secret returns header typ JWT and alg HS256, claims sub alice and name Ada, signatureStatus valid. expired and notYetValid are null because the payload has no exp and no nbf.

Read more

Leave the secret empty and signatureStatus is not verified. That is an honest gap, not a success. The signature was not checked. Verification on this page is HMAC only: HS256, HS384 and HS512. An RS256 token can still be decoded, and asking to verify it with a symmetric secret is an error, because a public-key signature is not an HMAC. A token that is not three segments fails before any of that.

The secret stays in the tab with the token. Decoding does not mean the token is safe to trust. The inspector page runs the same checks and is aimed at expiry. The signer is where this sample token was produced.

Use cases

  • A bearer token in a failing request should show sub alice and alg HS256 before anyone blames the server.
  • You have the HMAC secret and you want signatureStatus valid, or invalid if the secret is wrong.
  • The token has no exp, and you need to see expired null rather than assume it is fresh.
  • An RS256 token should decode, and a mistaken attempt to HMAC-verify it should fail clearly.

An HS256 token for alice, secret checked

Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhbGljZSIsIm5hbWUiOiJBZGEifQ.Nqb6ie-8gcMIXEPIIKNgKXLK5E11SoIbasJHr4o0J3g. HMAC secret some secret.

header typ JWT, alg HS256. claims sub alice, name Ada. signatureStatus valid. expired null. notYetValid null.

Why use Oddsock

not verified is a different answer from valid. Copying a token into a debugger that skips the signature is how a bad signature gets treated as a user.

Related tools

Using this tool

Only when signatureStatus is valid. Empty secret means not verified. The header and claims are just JSON and can be forged until the signature is checked.