Decode a JWT without the secret key
You do not need the secret to read a JWT. The header and payload are base64url encoded JSON, not encrypted. The secret is only needed to verify the signature, which proves the token was not changed.
Last reviewed 2026-11-04.
This tool decodes only. It does not check the signature, so a decoded token is not proof the token is genuine.
Worked example
A JWT is three parts joined by dots: header.payload.signature. Take the first part of the sample token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 decodes to {"alg":"HS256","typ":"JWT"}.
The second part decodes the same way into the claims such as sub, iat and exp. Use the "HS256 sample (expired)" sample in the decoder above to see all three parts.
Decode in code
JavaScript (Node.js)
const payload = JSON.parse(Buffer.from(token.split('.')[1], 'base64url').toString('utf8'));Python
import base64, json
p = token.split('.')[1]
p += '=' * (-len(p) % 4)
payload = json.loads(base64.urlsafe_b64decode(p))Shell
echo "$TOKEN" | cut -d. -f2 | tr '_-' '/+' | base64 -d
The shell version may print a padding warning; the JSON is still shown.
What the secret is for
The signature is a hash or signature over the header and payload. Only a holder of the key can create a valid one, and your server recomputes it to check. Anyone can read a token; no one without the key can forge one.
Never put secrets in a payload for that reason. Also watch for tokens whose header says "alg":"none"; they carry no signature and must be rejected.
Running this on a server
Verification runs on your server with the key. If you are standing up a small API, the hosting guide compares where to run it.
Frequently asked questions
Is a JWT encrypted?
A standard signed JWT (JWS) is not. Encrypted tokens (JWE) are a different format with five parts.
Can the decoder check the signature?
No. Verification needs the secret or public key and belongs on your server.
Why not decode on a third party site?
A token can grant access. Use a decoder that runs in your browser and sends nothing, like the one above.
Sources
- RFC 7519: JSON Web Token checked 2026-11-04
- RFC 7515: JSON Web Signature checked 2026-11-04