What is JWT? How to Decode a Token
When login fails or a gateway returns signature invalid, separate “I can read the claims” from “the signature holds”. A JWT is three text parts, not a vault.
What is a JWT?
A JSON Web Token encodes claims as a transportable string. The usual shape is three Base64URL parts joined by dots: header, payload, signature. Header and payload are JSON. The signature covers the first two parts so tampering can be detected. It does not hide the JSON.
Base64URL is like Base64 with -/_ and often without = padding so the token can live in headers. Pasting a whole JWT into a generic Base64 box is unreliable—split on dots first.
sub, exp, iat, iss, and aud are claims anyone can read. Confidentiality depends on HTTPS and short TTL, not obscurity. Use the JWT decoder to inspect; keep verify on its own page.
Why JWTs exist
Stateless HTTP still needs “who, until when, for which audience”. Signed claims on the client are a common alternative to server sessions, especially across gateways. The gateway verifies, then services read claims.
That is integrity of statements, not secrecy. Put a national ID in the payload and every decoder will show it. Sensitive data stays server-side.
Two debug mix-ups: the token is expired, or alg was set to none. The first is an exp question; the second is a verify question.
How to parse a JWT
Split on .. The first JSON should include alg and usually typ. The second is claims. The third is the signature bytes. Showing it is not verifying it.
To read claims, open the JWT decoder. It does not use a secret, so it cannot prove the token came from your issuer. Anyone can encode a header and payload and attach junk.
To ask whether the signature and expiry hold, open JWT verify with an HMAC secret or PEM public key. Check alg, exp, and iss/aud/sub. Production still verifies on the server. Reject none.
Decode is not login
HS256 is a shared secret; RS256/ES256 sign with a private key and verify with a public key. Mixing those materials yields signature invalid. Read alg first.
exp is Unix seconds. A clock skew or treating milliseconds as seconds mis-labels expiry. Compare with a Unix timestamp converter.
Do not leave production tokens on shared machines. A leaked token can be replayed until it expires. Encoding tools live on the encoding hub; verify also appears on the hash & token hub.
Related tools
FAQ
Is JWT encryption?
Not by default. Header and payload are encoded, not encrypted. JWE is a different wrapping.
I can see the user id but verify fails.
Decode does not check the signature. Visible claims only mean Base64URL reversed. Verify failures are usually key, expiry, or alg.
Can I accept alg none?
Not as a credential. No signature means no tamper detection.
Are JWTs always three parts?
Typical access tokens are JWS with three segments. Wrong dot count is not something to verify as a normal JWT.
Decoder or verify?
Decoder to read. Verify to trust. Separate pages so the queries stay distinct.