JWT Decoder

Decode JWT tokens instantly. Runs entirely in your browser — tokens are never sent to any server.

JWT Token

How JWT tokens work

A JWT has three Base64-encoded parts separated by dots: Header (algorithm) · Payload (claims) · Signature (verification). Paste any JWT above to inspect it.

eyJhbGci….eyJzdWIi….SflKxwRJ…

What is a JWT Token?

A JSON Web Token (JWT) is a compact, URL-safe token used to represent claims between two parties. When you log into a web app, the server sends back a JWT that your browser sends with every future request to prove your identity.

JWT Structure

A JWT has three Base64Url-encoded parts separated by dots:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIsIm5hbWUiOiJSYXZpIiwiaWF0IjoxNzAwMDAwMDAwfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
■ Header■ Payload■ Signature

Standard JWT Claims

ClaimNameDescription
subSubjectIdentifies the user — usually the user ID
issIssuerThe server or service that issued the token
audAudienceThe recipients the token is intended for
expExpirationUnix timestamp after which the token is invalid
iatIssued AtUnix timestamp when the token was created
nbfNot BeforeToken is not valid before this Unix timestamp
jtiJWT IDUnique identifier to prevent replay attacks
algAlgorithmSigning algorithm used — HS256, RS256, etc.

Decode vs Verify

✓ Decoding (what JSONKit does)

  • • Reads header and payload by reversing Base64Url encoding
  • • No secret key needed
  • • Anyone with the token can do this
  • • Safe to do in the browser

⚠ Verifying (server only)

  • • Checks signature using the secret key
  • • Proves token was not tampered with
  • • Must only happen on the server
  • • Never do this in the browser

Check Token Expiry in Code

js
// Decode and check expiry in JavaScript
const parts   = token.split(".");
const payload = JSON.parse(atob(parts[1]));
const now     = Math.floor(Date.now() / 1000);

if (payload.exp && payload.exp < now) {
  console.log("Token expired at:", new Date(payload.exp * 1000));
} else {
  console.log("Token is valid");
}

JWT Security Best Practices

  • Never put secrets in the payloadThe payload is only encoded, not encrypted — anyone with the token can read it
  • Always verify on the serverClient-side signature verification is not meaningful security
  • Use short expiry timesAccess tokens should expire in 15 minutes to 1 hour — use refresh tokens for longer
  • Always use HTTPSJWTs transmitted over plain HTTP can be intercepted and reused
  • Never log tokensTokens in log files are a security risk if logs are not properly secured

Frequently Asked Questions

Yes. Decoding happens entirely in your browser using JavaScript's atob() function. Your token is never sent to any server.

The header and payload are only Base64Url encoded, not encrypted. Anyone with the token can read them. The secret key is only needed to verify the signature — which proves the token was not tampered with.

The exp claim in the payload is a Unix timestamp. JSONKit compares it to the current time. If exp is in the past, the token has expired and should not be accepted by the server.

HS256 (HMAC SHA-256) is common for simple use cases. RS256 (RSA SHA-256) is better for systems where the token issuer and verifier are different services, as it uses asymmetric keys.

Related Tools