Skip to tool

JWT Decoder

Token

Header, payload and time claims

Decode a JSON Web Token (JWT)

A JSON Web Token (JWT) is a string of three dot-separated parts: a header, a payload of claims and a signature. The header and payload are base64url-encoded JSON, so anyone holding the token can read them. This tool decodes them and shows the signing algorithm and time claims.

Decoding is not verification. The tool does not check the signature, takes no secret or public key, and cannot tell whether a token is genuine or modified. Use it to inspect tokens while debugging; leave trust decisions to a server or JWT library that verifies them.

How JWT decoding works

A leading "Bearer ", line breaks and surrounding whitespace are removed, then the token is split on dots. Signed JWTs use the JWS compact serialization (RFC 7515), which has exactly three segments; any other count is reported as an invalid format. Header and payload are base64url (RFC 4648, section 5), which uses - and _ instead of + and / and omits = padding. The tool reverses this, decodes UTF-8 and parses each segment as a JSON object, showing an error for a segment that fails.

The alg value, such as HS256 (HMAC-SHA256), RS256 (RSA) or ES256 (ECDSA), is registered in RFC 7518. The signature is displayed unchanged; checking it would require recomputing it with the correct key, which this tool does not do.

iat (issued at), exp (expiration) and nbf (not before) are NumericDate values from RFC 7519: seconds since 1970-01-01T00:00:00Z. The token is marked Expired when your device's clock is at or after exp, Not Yet Valid when it is before nbf, and Active otherwise, including when there is no exp.

Example: decoding the sample token

The sample's first segment, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9, decodes to {"alg":"HS256","typ":"JWT"}, so the alg chip shows HS256.

The second segment decodes to {"sub":"1234567890","name":"John Doe","iat":1735689600,"exp":1900000000}. iat is shown as 2025-01-01T00:00:00.000Z and exp as 2030-03-17T17:46:40.000Z, so the status reads Active until then.

The third segment, SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c, is 43 characters, or 32 bytes: the length of an HMAC-SHA256 output. It was copied from a different token (the common jwt.io example), so verification would fail, yet the decoder shows it without warning. Decoded claims must not be trusted before verification.

What this decoder does not do

  • It does not verify signatures and has no field for a key. A token that decodes cleanly can still be forged or altered.
  • It does not validate iss, aud or sub; they appear as ordinary payload fields.
  • Expiry uses your device's clock with no leeway. RFC 7519 allows a few minutes for clock skew, so a server may accept a token shortly after it shows Expired here.
  • Encrypted JWE tokens (five segments) and JWS JSON serialization are not supported.
  • Tokens with alg none have an empty third segment; header and payload decode, and the Signature section says the token is unsigned.
  • Time claims stored as strings are not converted to dates.
  • If the header or payload does not decode, the tool shows which part failed and does not show the other.

JWT questions

Can I trust the claims after decoding a token?

No. Anyone can encode any header and payload. Only verifying the signature with the issuer's secret or public key, then checking exp, nbf, iss and aud, shows the claims are authentic. Do this on the server with a maintained JWT library.

Is a JWT encrypted?

A signed JWT is not. Base64url is an encoding, so anyone with the token can read the payload. Do not put secrets in it. Encrypted tokens use JWE, which this tool does not handle.

What is the difference between HS256 and RS256?

HS256 is HMAC with SHA-256: the same shared secret both signs and verifies, so every service that checks tokens can also issue them. RS256 is an RSA signature (RSASSA-PKCS1-v1_5 with SHA-256): the issuer signs with a private key and others verify with the public key, often published as a JWKS. ES256 works like RS256 but uses an ECDSA P-256 key and produces a shorter signature. The alg chip shows which one a token's header declares.

How do I check if a JWT is expired?

Read the exp claim in the payload. It is a NumericDate: seconds since 1970-01-01 UTC, not milliseconds. The token is expired once the current time reaches exp. Paste the token above to see exp, iat and nbf as dates and a status of Active, Expired or Not yet valid. In JavaScript, compare exp with Math.floor(Date.now() / 1000).

Why does the tool show Active for a token my server rejects?

Active only means exp and nbf did not fail against your clock. The server may reject an invalid signature, a rotated key, a wrong issuer or audience, a revoked token or a different clock.

Is it safe to paste a production token here?

A valid token works as a credential until it expires, so anyone who obtains it can use it. Prefer test or expired tokens.

References