JWT Decoder - Decode JSON Web Tokens Online
What You See After Pasting a Token
A JSON Web Token (RFC 7519) is three Base64URL strings joined by dots:
header.payload.signature. The decoder splits the token at its two dots, Base64URL-decodes the
header and payload, and shows both as formatted JSON. Above them you
get the expiry status, and the exp, iat and
nbf timestamps converted from Unix seconds to your local
time. The signature is shown as-is, because it is binary data, not
JSON.
Example
A typical access token payload decodes to something like:
{
"iss": "https://auth.example.com/",
"sub": "user_8812",
"aud": "api.example.com",
"scope": "read:orders write:orders",
"iat": 1735689600,
"exp": 1735693200
} iat 1735689600 is 1 January 2025 00:00 UTC and
exp is one hour later, so this token was valid for 60
minutes. If an API returns 401 for a token like this, the first things
to check are whether exp has passed, whether
aud matches the API you are calling, and whether
iss is the issuer the API trusts. A 403 more often means
the token is valid but the scope or role claims are
missing something.
Decoding Is Not Verification
The header and payload are only encoded, so anyone can read them and
anyone can write a token with whatever claims they like. The signature
is what proves a token came from the issuer and was not changed. To
check it here, paste the HMAC secret for HS algorithms or the issuer's
PEM public key for RS, PS and ES. Use this for debugging only.
Production code should verify every token with a maintained JWT
library, pin the algorithms it accepts, and reject
alg: none.
Header Fields Worth Knowing
alg: the signing algorithm. HS256 uses a shared secret; RS256 and ES256 use a private key to sign and a public key to verify.kid: which of the issuer's keys signed the token. Use it to pick the right entry from a JWKS.typ: usuallyJWT, sometimesat+jwtfor OAuth access tokens.
To compute an HS256 signature by hand, take the HMAC-SHA256 of
header.payload with the
HMAC generator, then convert the
Base64 output to Base64URL (replace + with
-, / with _, and drop the
= padding). To decode an ordinary Base64 string, use the
Base64 decoder, and to convert other Unix
timestamps, use the epoch converter.
Related Tools
Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings back to plain text.
URL Encode / Decode
Percent-encode or decode URLs and query-string parameters safely.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.
MD5 Hash Generator
Generate MD5 hashes from text for checksums and legacy systems.