JWT decoder
Paste a JSON Web Token to see its header and payload, with its expiry and issue dates turned into readable times. The decoder doesn't check the signature, so a token that decodes here can still be forged. It runs in your browser; nothing you enter is uploaded.
What's in a JWT
A JWT is three base64url strings joined by dots: a header, a payload, and a signature. The header and payload are JSON. The header
{"alg":"HS256","typ":"JWT"} encodes to eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. Almost every token starts
with eyJ, because that's how Base64 encodes {" followed by a letter. You can paste a token with its
Bearer prefix still on, and the decoder drops the prefix.
The payload holds the claims, the statements the token makes. RFC 7519, the standard that defines JWTs, registers seven:
| Claim | Meaning |
|---|---|
iss | Issuer: who created the token |
sub | Subject: the user or thing the token is about |
aud | Audience: the service the token is meant for |
exp | Expiry time |
nbf | Not valid before this time |
iat | Issued at |
jti | A unique ID for this token |
Any other claim, such as email or role, is one the issuer chose to add. The three dates are Unix timestamps in
seconds, and the decoder converts them in the table above the header: "exp": 1700000000 shows as 2023-11-14T22:13:20.000Z.
Decoding a token doesn't prove it's genuine
Anyone can decode a JWT, edit its payload, and encode it again. Only the signature shows that the token came from the issuer unchanged. Checking it takes the issuer's key: the shared secret for HS256, or the public key for RS256 and ES256. A server that accepts tokens has to:
- verify the signature with an algorithm it picked in advance
- reject
"alg": "none", which marks a token with no signature - compare
expandnbfwith the current time
Libraries such as jose for JavaScript and PyJWT for Python do these checks for you.
The payload isn't encrypted, so never put a password or other secret in it. Tokens that have to hide their contents use JWE, which has five parts instead of three, and the decoder can't read those.
Which signing algorithm to use
The algorithm names come from RFC 7518.
| alg | Method | Who can sign and verify |
|---|---|---|
HS256 | HMAC with SHA-256 | One shared secret does both |
RS256 | RSA with SHA-256 | The private key signs; the public key verifies |
ES256 | ECDSA on P-256 with SHA-256 | Like RS256, with much shorter keys and signatures |
Use HS256 only when the same service issues and checks its tokens. As soon as another service verifies them, switch to ES256 or RS256, so that service holds only the public key and can't issue tokens of its own.
Questions
Is it safe to paste a real token here?
Yes. The decoder runs in your browser and never sends the token anywhere. Still treat a real token like a password until it expires, because anyone who copies a valid token can use it.
Why is the expiry date tens of thousands of years away?
The issuer wrote the date in milliseconds instead of seconds. Read as seconds, 1700000000000 lands in the year 55840.