How to use the JWT Decoder
- Paste a token into the input. A leading “Bearer ” is removed for you.
- Read the decoded header and payload, and the claims table with dates in plain language.
- 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.
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) andiat(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.comfor 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,iatandnbfinto 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.