Skip to content

JWT Decoder

Decode a JSON Web Token’s header and claims, check expiry and verify HMAC signatures.

Runs in your browser. Nothing is uploaded.

Encoded token

Algorithm HS256

Header

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

Payload

{
  "sub": "1234567890",
  "name": "John Doe",
  "iat": 1516239022
}

Claims

ClaimValueMeaning
sub1234567890Subject
nameJohn DoeName
iat2018-01-18T01:30:22Z (1516239022)Issued at

How to use the JWT Decoder

  1. Paste a token into the input. A leading “Bearer ” is removed for you.
  2. Read the decoded header and payload, and the claims table with dates in plain language.
  3. For HS256, HS384 or HS512 tokens, enter the secret and select Verify signature.

What is inside a JWT?

A JSON Web Token has three parts separated by dots: a header, a payload and a signature. The first two are JSON, Base64URL-encoded. They are encoded, not encrypted, so anyone with the token can read them. The signature lets the receiver check that nobody changed the first two parts.

Example
header.payload.signature

{"alg":"HS256","typ":"JWT"}            ← header
{"sub":"1234567890","iat":1516239022}  ← payload (claims)

Standard claims

  • iss (issuer): who created the token.
  • sub (subject): who the token is about, often a user ID or username.
  • aud (audience): who the token is meant for.
  • exp (expires), nbf (not before) and iat (issued at): times in seconds since 1 January 1970, UTC.
  • jti: a unique ID that lets a server reject a token used twice.

JWTs in Salesforce

The OAuth 2.0 JWT Bearer flow lets a server sign in to Salesforce without a password. It signs a token with RS256 using the private key that matches the certificate uploaded to a connected app. The claims Salesforce expects are:

  • iss: the connected app’s consumer key.
  • sub: the Salesforce username to sign in as.
  • aud: https://login.salesforce.com, https://test.salesforce.com for sandboxes, or your community URL.
  • exp: an expiry no more than three minutes away.

In Apex, the Auth.JWT, Auth.JWS and Auth.JWTBearerTokenExchange classes create and exchange these tokens.

Keep tokens safe

A valid token is a key: whoever holds it can act as the user until it expires. Only paste tokens into tools that run locally, like this one, and never share them in tickets or chat.

Features and limitations

What it does

  • Decodes the header and payload, and lists every claim with a readable label.
  • Turns exp, iat and nbf into UTC dates, and shows whether the token has expired.
  • Verifies HMAC signatures (HS256, HS384, HS512) with the browser’s built-in Web Crypto.
  • Explains malformed tokens, encrypted tokens (JWE) and unsigned “alg: none” tokens.
  • Runs entirely on your device, so tokens are never sent to a server.

What it does not do

  • RS256, ES256 and other public-key signatures are decoded but not verified.
  • Encrypted tokens (JWE, five parts) cannot be read without the decryption key.
  • Decoding is not validation: always verify tokens on the server before trusting them.

Questions about the JWT Decoder

No. Decoding and signature checks run in your browser using built-in features. Nothing is uploaded or stored.

JWT payloads are only encoded, not encrypted. The signature protects against changes, not against reading. Never put secrets in a JWT payload.

RS256 needs the issuer’s public key in PEM or JWK form. Verification of public-key signatures is planned; for now the tool decodes these tokens and shows their claims.

The exp claim is earlier than your device’s current time. A server would reject the token, although some allow a minute or two of clock skew.

Yes. It is the widely published example from the JWT standard’s community site, signed with the secret “your-256-bit-secret”.