Skip to content

JWT Decoder

Paste a JSON Web Token to decode it instantly: the header, payload and every claim explained, whether it has expired, and a signature check with your secret or public key. Nothing leaves your browser.

Header

{
  "alg": "HS256",
  "typ": "JWT"
}

Payload

{
  "sub": "1234567890",
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "scope": "read:apis write:apis",
  "iat": 1792800000,
  "exp": 1792886400,
  "iss": "https://auth.example.com"
}

Claims explained

sub1234567890Subject: who the token is about (usually a user ID)
nameAda LovelaceThe user's full name
emailada@example.comThe user's email address
scoperead:apis write:apisScopes (permissions) granted to the token
iat17928000002026-10-24T00:00:00ZIssued at: when the token was created
exp17928864002026-10-25T00:00:00ZExpiration time: the token must be rejected after this
isshttps://auth.example.comIssuer: who created and signed the token

Verify signature (HS256)

Decoding and verification run entirely in your browser with the Web Crypto API. Tokens and keys are never sent anywhere or stored, but treat production tokens as passwords anyway.

How to decode a JWT

  1. Paste the token (with or without the “Bearer ” prefix) into the Encoded token box.
  2. The header and payload appear decoded, with time claims shown as dates and an expiry check.
  3. To verify it, paste the HMAC secret (HS256/384/512) or PEM public key (RS, PS or ES algorithms).

What's inside a JWT

A JWT is three Base64URL strings joined by dots: header.payload.signature.

PartContainsExample
HeaderThe signing algorithm and token type{"alg":"HS256","typ":"JWT"}
PayloadThe claims: who the token is for, when it expires, permissions{"sub":"123","exp":1792886400}
SignatureA signature over the first two parts, made with a secret or private key3GqyuvYk-5I3Ym…

Signing algorithms

AlgorithmKeyWho can verify
HS256 / HS384 / HS512One shared secret (HMAC)Anyone with the secret, which can also create tokens
RS256 / PS256RSA private key signs, public key verifiesAnyone with the public key
ES256 / ES384Elliptic-curve key pair (smaller signatures)Anyone with the public key
noneNo signatureNever accept these

Decode a JWT in code

JavaScript
// Decode (not verify) a JWT in the browser or Node.js 16+
function decodeJwt(token) {
  const part = token.split(".")[1].replace(/-/g, "+").replace(/_/g, "/");
  const bytes = Uint8Array.from(atob(part), (c) => c.charCodeAt(0));
  return JSON.parse(new TextDecoder().decode(bytes));
}

// Node.js only: Buffer understands base64url directly
const payload = JSON.parse(Buffer.from(token.split(".")[1], "base64url").toString());

JWT security checklist

  • Always verify the signature on the server, and pin the expected algorithm (never trust the token's own alg).
  • Check exp, nbf, iss and aud, not just the signature.
  • Keep expiry short (minutes to hours) and use refresh tokens for longer sessions.
  • Don't put passwords, card numbers or other secrets in the payload: anyone can read it.

Calling an API that returns 401 Unauthorized? Decode your token here to check it hasn't expired. More tools: Base64 decoder, Unix timestamp converter.

Frequently asked questions

Can you decrypt a JWT?

Most JWTs aren't encrypted at all: they're signed JWTs (JWS), whose header and payload are just Base64URL-encoded, so anyone can decode and read them, as this tool does. Encrypted JWTs (JWE, with 5 parts) need the private key. That's why you should never put secrets in a JWT payload.

What's the difference between decoding and verifying a JWT?

Decoding reads the claims. Verifying checks the signature with the secret or public key, proving the token was issued by who it claims and hasn't been changed. Servers must always verify; a decoded but unverified token can't be trusted.

Is it safe to paste my JWT into this decoder?

Decoding and signature checks run entirely in your browser with JavaScript and the Web Crypto API; the token and key are never sent to a server or saved. Still, a live token is a credential: prefer test tokens, and don't share tokens from production.

Why does my JWT say it's expired?

The exp claim is a Unix timestamp in seconds. If it's in the past, the token has expired and APIs will return 401 Unauthorized; get a new token with your refresh token or by logging in again. Small differences can also come from clock skew between servers, which libraries usually allow a few seconds for.

Where do I find the key to verify a JWT?

For HS256 it's the shared secret your app configured. For RS256 or ES256 it's the issuer's public key, usually published as a JWKS at https://<issuer>/.well-known/jwks.json. This tool accepts PEM public keys; convert a JWK to PEM first if needed.

More free developer tools